Commit graph

1536 commits

Author SHA1 Message Date
Sandro Jäckel 6dc1b1ed0f nixos/librenms: update config cache
otherwise any change to .env is never reflected.

(cherry picked from commit 1119d225de)
2025-10-23 11:34:56 +00:00
Rhys 4bcedb3313 nixos/ups: remove Slice from UPS shutdown service
system-ups.slice conflicts with shutdown.target, so
ups-killpower.service is never queued at shutdown.
The slice isn't doing anything; removing it is a simple fix.

(cherry picked from commit 30aa6b71f2)
2025-10-14 20:24:18 +02:00
Philip Wilk 7fa9b1e6f7 nixos/ups: add package option
(cherry picked from commit e97badfdd7)
2025-10-14 20:24:15 +02:00
Wolfgang Walther 5cbdb94f3a
treewide: remove redundant parentheses
Auto-fixed by nixf-diagnose.

(cherry picked from commit 91a8fee3aa)
2025-10-05 12:59:25 +02:00
Wolfgang Walther 1c6af9ba0a
treewide: remove unused with
Auto-fixed by nixf-diagnose.

(cherry picked from commit c283f32d29)
2025-10-05 12:38:28 +02:00
Wolfgang Walther 6c1e6f90d3
treewide: remove unused rec
Auto-fix by nixf-diagnose.

(cherry picked from commit 90e7159c55)
2025-10-05 12:38:23 +02:00
Wolfgang Walther 7fdb524aee
[Backport release-25.05] nixos/grafana: add prune option to provision.datasources (#438966) 2025-09-20 14:51:41 +00:00
Maximilian Bosch 27d2e27300 nixos/grafana: don't set X-XSS-Protection anymore
Part of #438800.

The OWASP recommentation[1] is:

> The X-XSS-Protection header has been deprecated by modern browsers
> and its use can introduce additional security issues on the client
> side. As such, it is recommended to set the header as X-XSS-Protection: 0
> in order to disable the XSS Auditor, and not allow it to take the default
> behavior of the browser handling the response. Please use
> Content-Security-Policy instead.

Hence, we turn this off, diverging from the upstream defaults here. An
upstream issue has been opened[2].

[1] https://owasp.org/www-project-secure-headers/#x-xss-protection
[2] https://github.com/grafana/grafana/issues/110369

(cherry picked from commit 409107d2f5)
2025-09-01 20:52:12 +00:00
Maximilian Bosch e1be8d8dd1 nixos/grafana: add prune option to provision.datasources
Closes #430532

(cherry picked from commit c7eb566c41)
2025-08-31 17:15:12 +00:00
diniamo 8fa81f2c6c nixos/grafana: add openFirewall option
(cherry picked from commit 5bb944c6f5)
2025-07-25 16:14:53 +00:00
Wolfgang Walther aefcb0d50d
treewide: run nixfmt 1.0.0 2025-07-24 14:58:18 +02:00
Wolfgang Walther a46262ae77
treewide: run treefmt with mdcr/nixfmt 2025-07-24 14:58:15 +02:00
Wolfgang Walther ad1379b5e0
treewide: fix syntax errors in nix code blocks
Fixes all code blocks with "nix" language in markdown files for syntax
errors to be able to run nixfmt in the next step.

(cherry picked from commit 6c47e7d5da)
2025-07-24 14:46:05 +02:00
HE7086 e20c1021e3 nixos/prometheus-wireguard-exporter: add support for new flags
(cherry picked from commit ab2dc5c3f9)
2025-07-01 10:18:38 +00:00
Wolfgang Walther 06d883d093
[Backport release-25.05] nixos/prometheus-wireguard-exporter: Add a new option to export wireguard_latest_handshake_delay_seconds. (#421205) 2025-06-30 11:28:23 +00:00
Gautier DI FOLCO fa64557806 nixos/prometheus.alertmanagerIrcRelay: fix network-online.target ordering but not depending warning
(cherry picked from commit c689716d48)
2025-06-30 10:27:03 +00:00
Jeevan Shikaram 13877297e7 nixos/prometheus-wireguard-exporter: Add a new option to export wireguard_latest_handshake_delay_seconds.
(cherry picked from commit b10dabd009)
2025-06-30 10:25:58 +00:00
liberodark 71c589f8bb nixos/glpi-agent: add hardening
(cherry picked from commit e673eca2be)
2025-05-30 15:10:17 +00:00
Sandro Jäckel 314cfdddb5
nixos/librenms: seed database in module, not only in test
To properly use librenms and create a user, you need the seeded roles
like admin.
2025-05-13 14:24:27 +02:00
Gabriel Smith 710e189c6e nixos/ups: run upsmon as non-root user "nutmon" by default
NUT documentation strongly suggests running `upsmon` as a non-root user
with very limited permissions. This includes only read access to
`upsmon.conf`.

Previously the `RUN_AS_USER` setting could be overwritten with
`mkForce`, but this left the system with technically incorrect
permissions on `upsmon.conf` that would prevent reloading. This patch
provides a way to change the user that `upsmon` runs as while
maintaining correct permissions on `upsmon.conf`.

Fixes #318582
2025-05-09 23:11:33 +02:00
Maximilian Bosch 77a41a7dd8
grafana: 11.6.0+security-01 -> 12.0.0
Closes #404580

ChangeLog: https://github.com/grafana/grafana/releases/tag/v12.0.0

A few changes were necessary here:

* the provision seems to be delayed now, so the `machine.succeed` broke
  because the result was tested before the provisioning was finished.
  Using `wait_until_succeeds` to solve this.

* Work around a problem that got unnoticed during #399404:
  the setup-hook is also run in the `goModules` derivation, but
  `offlineCache` is missing. As a result, the build breaks. I guess this
  was unnoticed because everyone had a goModules with the previous hash
  in their store.

Co-authored-by: Emily <git@emilylange.de>
2025-05-08 07:29:39 +02:00
Sandro 9cacd7ee42
nixos/prometheus/alertmanager-ntfy: init module (#402291) 2025-05-05 13:38:24 +02:00
Willy 67a22705e7 nixos/graphite: use lib.getExe 2025-05-02 22:08:55 +02:00
Willy 9ce87bd911 nixos/graphite: fix django-admin executable name 2025-05-02 22:08:55 +02:00
Defelo 25977534c0
nixos/prometheus/alertmanager-ntfy: init module 2025-04-29 13:03:58 +02:00
Jonathan Davies f9aba46b57
nixos/prometheus-exporters/ebpf: init 2025-04-23 16:30:28 +01:00
Florian Klink 5d094c2338 nixos/alloy: set After=network.target
This prevents the network from being torn down before alloy itself it
stopped.

Alloy tries to flush its WAL on SIGTERM, and if the network stack is
already down, it tries to flush logs up to 90s during shutdown/reboot.

From https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/:

> network.target has very little meaning during start-up. It only
> indicates that the network management stack is up after it has been
> reached. Whether any network interfaces are already configured when
> it is reached is undefined. Its primary purpose is for ordering
> things properly at shutdown: since the shutdown ordering of units in
> systemd is the reverse of the startup ordering, any unit that is order
> After=network.target can be sure that it is stopped before the network
> is shut down if the system is powered off. This allows services to
> cleanly terminate connections before going down, instead of abruptly
> losing connectivity for ongoing connections, leaving them in an
> undefined state. […]
2025-04-18 23:38:44 +02:00
lucasew 51ac5d673e cockpit: format
Signed-off-by: lucasew <lucas59356@gmail.com>
2025-04-15 11:54:12 -03:00
lucasew 45088ac0b0 cockpit: fix sudo login, patch tweaking, option for allowed origins
Signed-off-by: lucasew <lucas59356@gmail.com>
2025-04-15 11:50:01 -03:00
Pol Dellaiera 068a5dea67
prometheus-ecoflow-exporter: init ecoflow nixos module integration (#395428) 2025-04-04 11:24:56 +02:00
Pol Dellaiera 6585c0a522
prometheus-tibber-exporter: init tibber nixos module integration (#395393) 2025-04-04 11:24:30 +02:00
PAEPCKE, Michael 72857eab9f
prometheus-tibber-exporter: init tibber nixos module integration 2025-04-04 07:19:56 +00:00
PAEPCKE, Michael 979caf8f05
prometheus-ecoflow-exporter: init ecoflow nixos module integration 2025-04-04 07:18:40 +00:00
Florian Klink 28b1639d57 nixos/grafana-agent: remove
As described in https://github.com/NixOS/nixpkgs/pull/394017,
grafana-agent does not build with Go 1.23 anymore, and Go 1.22 has been
removed.

grafana-agent has been deprecated by Grafana (in favour of Grafana
Alloy), and will be EOL on 2025-11-01, which would be part of the
upcoming 25.05 release.

Instead of leaving us with a broken package, drop it alltogether, and
add release notes.
2025-04-02 21:45:31 +01:00
Silvan Mosberger 374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
PAEPCKE, Michael cdb80c1f44
prometheus-exporter: init chrony module 2025-03-30 11:14:30 +00:00
Arian van Putten b684e9c6d6
fluent-bit: link against Nix dependencies, fix Darwin builds, and add NixOS module (#365493) 2025-03-21 11:39:18 +00:00
Moraxyc eca4c6ea19
nixos/scrutiny: use genJqSecretsReplacementSnippet 2025-03-20 22:27:06 +08:00
commiterate 3366b27e59 fluent-bit: link against Nix dependencies, fix Darwin builds, and add NixOS module 2025-03-19 18:48:46 -04:00
Pol Dellaiera b29c5b7119
treewide: add documentation for nixos systemd units (#389283) 2025-03-15 21:30:08 +01:00
jopejoe1 dca7e827b3
nixos: Replace custom cfg format handling with pkgs.formats (#314933) 2025-03-14 21:08:14 +01:00
xanderio 6607cf789e
nixos/librenms: regenerate caches after every package change (#388914) 2025-03-13 08:39:42 +01:00
h7x4 ab0564bd10
treewide: add documentation for nixos systemd units 2025-03-12 18:00:38 +01:00
Jennifer Graul 232494bd5c
nixos/librenms: regenerate caches after every package change
The LibreNMS cache may contain paths to the old package and may break
when the old package is removed. So it is not enough to clear the cache
only on version updates, as the package will also change when build
inputs change.

This commit updates the setup script to regenerate the cache on every
package change. In addition, it now only performs migrations when the
package version has changed, since the migrations only change on version
updates and don't need to be applied on every package change.
2025-03-11 08:48:54 +01:00
Alexander Sieg 6fdc890e79
nixos/alloy: automaticlly include all .alloy files in reload trigger 2025-03-10 10:13:59 +01:00
shelvacu 1a4575f9db
nixos/modules: Add security.pki.caBundle option and make all services use it for CA bundles (#352244)
Previously some modules used `config.environment.etc."ssl/certs/ca-certificates.crt".source`, some used `"/etc/ssl/certs/ca-certificates.crt"`, and some used `"${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"`. These were all bad in one way or another:

- `config.environment.etc."ssl/certs/ca-certificates.crt".source` relies on `source` being set; if `text` is set instead this breaks, introducing a weird undocumented requirement
- `"/etc/ssl/certs/ca-certificates.crt"` is probably okay but very un-nix. It's a magic string, and the path doesn't change when the file changes (and so you can't trigger service reloads, for example, when the contents change in a new system activation)
- `"${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"` silently doesn't include the options from `security.pki`

Co-authored-by: Shelvacu <git@shelvacu.com>
2025-03-08 08:41:08 +00:00
Sandro 5ca7fffe87
nezha: 0.20.3 -> 1.9.5; nezha-agent: 0.20.5 -> 1.9.2; nixos/nezha-agent: refactor (#361515) 2025-03-05 17:38:42 +01:00
Thomas Gerbet ee2c1b8352
nixos/osquery: fix database_path + logger_path opts per systemd docs (#370003) 2025-03-04 14:51:12 +01:00
Moraxyc 1235bed1b5
nixos/nezha-agent: refactor 2025-03-04 18:08:04 +08:00
bstanderline d784db18f2 nixos/osquery: set default database_path and logger_path 2025-03-04 09:43:07 +00:00