Commit graph

1168 commits

Author SHA1 Message Date
Jade Lovelace
6c5ab28fce nixos: fix a bunch of services missing dep on network-online.target
This was done by generating a truly hilarious configuration:

rg 'services\.[^.]+\.enable\t' opts-tags | cut -f1 > allonconfig.nix

The following were not tested due to other evaluation errors. They
should probably be manually audited.
services.amule
services.castopod
services.ceph
services.chatgpt-retrieval-plugin
services.clamsmtp
services.clight
services.dante
services.dex
services.discourse
services.dwm-status
services.engelsystem
services.foundationdb
services.frigate
services.frp
services.grocy
services.guacamole-client
services.hedgedoc
services.home-assistant
services.honk
services.imaginary
services.jitsi-meet
services.kerberos_server
services.limesurvey
services.mastodon
services.mediawiki
services.mobilizon
services.moodle
services.mosquitto
services.nextcloud
services.nullmailer
services.patroni
services.pfix-srsd
services.pgpkeyserver-lite
services.postfixadmin
services.roundcube
services.schleuder
services.self-deploy
services.slskd
services.spacecookie
services.statsd
services.step-ca
services.sympa
services.tsmBackup
services.vdirsyncer
services.vikunja
services.yandex-disk
services.zabbixWeb
2024-01-19 00:11:34 -08:00
WilliButz
bb9c7762bc
nixos/prometheus-snmp-exporter: add config check
This is introduced and enabled by default because the config syntax for
the exporter changed with release 0.23.0.

This should make the breaking config change obvious before services are
deployed with an incompatible old config.

The check is based on the check present in the blackbox-exporter module.
2024-01-17 20:34:30 +01:00
WilliButz
a8ea9fe492
nixos/prometheus-snmp-exporter: switch to new config syntax
Introduced with version 0.23.0, see
b75fc6b839/auth-split-migration.md
2024-01-17 20:32:45 +01:00
Patrik Keller
30b25fa102 nixos/netdata: add missing dependency for syslog alarms
Netdata depends on the `logger` utility for dispatching health alarms to
syslog. This dependency was missing in the systemd units environment.

Issue: https://github.com/NixOS/nixpkgs/issues/272702
Docs: https://learn.netdata.cloud/docs/alerting/notifications/agent-dispatched-notifications/syslog
Docs, archived: https://archive.is/mkQa4
2024-01-11 08:38:52 +01:00
Peder Bergebakken Sundt
3bf05ba941
Merge pull request #271481 from eliandoran/feature/snmpd
nixos/snmpd: init
2024-01-09 21:32:27 +01:00
Janik
6be9d4fc21
Merge pull request #266283 from Noodlesalat/ping-exporter-1.1.0
ping_exporter: init at 1.1.0
2023-12-31 20:50:30 +01:00
Maximilian Bosch
1d17e304ac
Merge pull request #273443 from jpds/thanos-query-replica-label-string
nixos/thanos: Changed query.replica-labels to a list parameter
2023-12-28 20:48:31 +01:00
Martin Weinelt
d4c4e0269d
Merge pull request #274460 from mweinelt/kea-ipc-runtimedir
nixos/kea: return to merged runtime directory; preserve runtime directories
2023-12-27 02:08:14 +01:00
Dee Anzorge
b4b9b08426
nixos/prometheus-exporters/kea: run under same user/group as kea
This fixes access to the kea unix sockets, after enabling
RuntimeDirectoryPreserve on the kea units.

https://github.com/NixOS/nixpkgs/pull/274460#issuecomment-1869702893
2023-12-26 21:42:58 +01:00
Nudelsalat
5d85f0eee8 nixos/prometheus-ping-exporter: init 2023-12-24 18:11:25 +01:00
WilliButz
ac58b65cf5
Merge pull request #275112 from r-ryantm/auto-update/prometheus-nginx-exporter
prometheus-nginx-exporter: 0.11.0 -> 1.0.0
2023-12-20 20:27:28 +01:00
Franz Pletz
faff9de754
nixos/prometheus/nginx-exporter: fix args for 1.0 2023-12-20 18:23:29 +01:00
Elian Doran
2b0bf78df6 nixos/snmpd: init 2023-12-19 18:54:24 +02:00
WilliButz
92ad5c907c
Merge pull request #274543 from fugidev/sabnzbd-exporter-loadcredential
nixos/prometheus-sabnzbd-exporter: use LoadCredential for apiKeyFile
2023-12-18 15:09:35 +01:00
Peder Bergebakken Sundt
45052e5e52
Merge pull request #273397 from ipetkov/nut
nixos/ups: fix shutting down the UPS from primary monitors
2023-12-18 15:06:22 +01:00
Fugi
6430b7a181
nixos/prometheus-sabnzbd-exporter: use LoadCredential for apiKeyFile 2023-12-18 14:48:49 +01:00
Martin Weinelt
cd6ccb1737 Revert "kea: use separate runtime directories for each service"
This reverts commit 413011ddf4.

Using separate lockfile directories prevents the different kea daemons
from using the interprocess sync lockfile.

Keeping the runtime directory around might be the better approach.
2023-12-15 13:51:19 +01:00
Janne Heß
6ad3977ec9
Merge pull request #253184 from tilpner/prometheus-headers
nixos/prometheus: add remote{Read, Write}.headers options
2023-12-13 21:53:52 +01:00
Jonathan Davies
c57a4037f5 nixos/thanos: Changed query.replica-labels to a list parameter.
Fixes: #273432
2023-12-10 23:55:15 +00:00
Ivan Petkov
fc004b09e5
nixos/ups: install udev rules for nut
This is necessary to allow the usbhid driver to successfully send
commands to the attached UPS.

It is possible to work around this by explicitly using setting the user
flag (e.g. `upsdrvctl -u root shutdown`), though it is much simpler to
install the udev rules rather than patch things further.
2023-12-10 11:23:37 -08:00
Ryan Lahfa
b69fbe2670
Merge pull request #272996 from RaitoBezarius/netdata-improvements 2023-12-09 14:00:48 +01:00
Raito Bezarius
db1e415c07 nixos/netdata: ensure analytics reporting is truly opted-out
Fixes 260035.
2023-12-09 00:47:56 +01:00
Sandro Jäckel
8c972ce2c0
nixos/grafana: fix deprecation warning by using grafana server instead of grafana-server
Deprecation warning: The standalone 'grafana-server' program is deprecated and will be removed in the future. Please update all uses of 'grafana-server' to 'grafana server'
2023-12-06 23:40:30 +01:00
Sandro Jäckel
cff247a127
nixos/grafana: create plugins directory in provisioning
The error message was:
msg="Failed to read plugin provisioning files from directory" path=/nix/store/gs2cy8n6ndsa1f7msf7ndl8f85xl1pzg-grafana-provisioning/plugins
 error="open /nix/store/gs2cy8n6ndsa1f7msf7ndl8f85xl1pzg-grafana-provisioning/plugins: no such file or directory"
2023-12-06 23:40:29 +01:00
maxine
f73dbfa5f8
Merge pull request #213006 from Majiir/nut
nixos/ups: add options for essential config files
2023-12-05 23:14:37 +01:00
Victor Hugo Aguiar Pacce
5c6c35d0f8 nixos/prometheus: add enableAgentMode option
Required for running a prometheus service under agent mode

Signed-off-by: Victor Hugo Aguiar Pacce <victorhugoaguiarpacce@gmail.com>
2023-12-05 11:24:04 -03:00
undefined
3c4370ca2f
prometheus-mongodb-exporter: fix service ExecStart 2023-12-03 17:54:21 +08:00
Majiir Paktu
c1793ff623 nixos/ups: add {users,upsmon,upsd} config options 2023-12-02 22:44:07 -05:00
Majiir Paktu
09002e9d23 nixos/ups: various fixes & clean up
- Ensure NUT_STATEPATH exists (fixes service startup)
- Use mode option to enable services (fixes #113735)
- Remove extraneous slash in paths (fixes confusing logs)
- Support reload for upsmon and upsd
- Remove ExecStart wrapper scripts
2023-12-02 22:42:14 -05:00
h7x4
79d3d59f58
treewide: replace mkPackageOptionMD with mkPackageOption 2023-11-30 19:03:14 +01:00
Weijia Wang
feeae486de
Merge pull request #261702 from h7x4/replace-mkoption-with-mkpackageoption
treewide: use `mkPackageOption`
2023-11-30 02:49:30 +01:00
h7x4
0a37316d6c
treewide: use mkPackageOption
This commit replaces a lot of usages of `mkOption` with the package
type, to be `mkPackageOption`, in order to reduce the amount of code.
2023-11-27 01:28:36 +01:00
Jörg Thalheim
501680a656 nixos/telegraf: include procps if procstat input is configured 2023-11-26 20:26:48 +01:00
Nick Cao
0840c28c43
Merge pull request #268991 from undefined-moe/mongodb-exporter
add prometheus-mongodb-exporter
2023-11-22 09:29:50 -05:00
undefined
b46ec2c40f
nixos/prometheus-mongodb-exporter: init module 2023-11-22 09:42:27 +08:00
Mario Rodas
c93541b24e
Merge pull request #264910 from anthonyroussel/ocsinventory-agent+nixos
nixos/ocsinventory-agent: init
2023-11-19 18:55:06 -05:00
Artturi
b736459b60
Merge pull request #260089 from anthonyroussel/thanos_0_32_4 2023-11-19 18:37:48 +02:00
Ryan Lahfa
ccfe07c316
Merge pull request #266270 from Ma27/postgresql-ownership-15 2023-11-17 18:02:17 +01:00
Ilan Joselevich
d7e7a2136e
Merge pull request #267761 from jpds/grafana-restart-on-failure
nixos/grafana: Set systemd unit to restart on failure
2023-11-17 00:59:25 +00:00
Kim Lindberger
9c4df4d618
Merge pull request #246992 from cransom/cransom-parsedmarc-smtp
nixos/parsedmarc: fix validation for smtp
2023-11-16 15:06:20 +01:00
Jonathan Davies
58cbf94b38 nixos/grafana: Set systemd unit to restart on failure 2023-11-15 23:20:59 +00:00
Felix Bühler
f2fc5b4195
Merge pull request #265696 from Stunkymonkey/nixos-exportarr
nixos/exportarr: init
2023-11-13 22:58:32 +01:00
Maximilian Bosch
48459567ae nixos/postgresql: drop ensurePermissions, fix ensureUsers for postgresql15
Closes #216989

First of all, a bit of context: in PostgreSQL, newly created users don't
have the CREATE privilege on the public schema of a database even with
`ALL PRIVILEGES` granted via `ensurePermissions` which is how most of
the DB users are currently set up "declaratively"[1]. This means e.g. a
freshly deployed Nextcloud service will break early because Nextcloud
itself cannot CREATE any tables in the public schema anymore.

The other issue here is that `ensurePermissions` is a mere hack. It's
effectively a mixture of SQL code (e.g. `DATABASE foo` is relying on how
a value is substituted in a query. You'd have to parse a subset of SQL
to actually know which object are permissions granted to for a user).

After analyzing the existing modules I realized that in every case with
a single exception[2] the UNIX system user is equal to the db user is
equal to the db name and I don't see a compelling reason why people
would change that in 99% of the cases. In fact, some modules would even
break if you'd change that because the declarations of the system user &
the db user are mixed up[3].

So I decided to go with something new which restricts the ways to use
`ensure*` options rather than expanding those[4]. Effectively this means
that

* The DB user _must_ be equal to the DB name.
* Permissions are granted via `ensureDBOwnerhip` for an attribute-set in
  `ensureUsers`. That way, the user is actually the owner and can
  perform `CREATE`.
* For such a postgres user, a database must be declared in
  `ensureDatabases`.

For anything else, a custom state management should be implemented. This
can either be `initialScript`, doing it manual, outside of the module or
by implementing proper state management for postgresql[5], but the
current state of `ensure*` isn't even declarative, but a convergent tool
which is what Nix actually claims to _not_ do.

Regarding existing setups: there are effectively two options:

* Leave everything as-is (assuming that system user == db user == db
  name): then the DB user will automatically become the DB owner and
  everything else stays the same.

* Drop the `createDatabase = true;` declarations: nothing will change
  because a removal of `ensure*` statements is ignored, so it doesn't
  matter at all whether this option is kept after the first deploy (and
  later on you'd usually restore from backups anyways).

  The DB user isn't the owner of the DB then, but for an existing setup
  this is irrelevant because CREATE on the public schema isn't revoked
  from existing users (only not granted for new users).

[1] not really declarative though because removals of these statements
    are simply ignored for instance: https://github.com/NixOS/nixpkgs/issues/206467
[2] `services.invidious`: I removed the `ensure*` part temporarily
    because it IMHO falls into the category "manage the state on your
    own" (see the commit message). See also
    https://github.com/NixOS/nixpkgs/pull/265857
[3] e.g. roundcube had `"DATABASE ${cfg.database.username}" = "ALL PRIVILEGES";`
[4] As opposed to other changes that are considered a potential fix, but
    also add more things like collation for DBs or passwords that are
    _never_ touched again when changing those.
[5] As suggested in e.g. https://github.com/NixOS/nixpkgs/issues/206467
2023-11-13 17:16:25 +01:00
Anthony Roussel
d4d6602ce3
nixos/thanos: remove with lib; notation
https://nix.dev/guides/best-practices#with-scopes
2023-11-12 11:21:47 +01:00
Anthony Roussel
65be712043
nixos/thanos: use mkPackageOptionMD 2023-11-12 11:08:53 +01:00
Anthony Roussel
9abb2a2116
nixos/thanos: remove deprecations
* replaced store.grpc.series-sample-limit by store.limits.request-samples
* replaced query.replica-label by query.replica-labels
* replaced store.addresses by endpoints
* removed block-sync-concurrency (removed upstream)
2023-11-12 11:08:52 +01:00
Anthony Roussel
abed24c0d6
nixos/thanos: fix documentation 2023-11-12 11:08:52 +01:00
Anthony Roussel
312e7f8ae0
nixos/thanos: add ExecReload command to SystemD services 2023-11-12 11:08:52 +01:00
Anthony Roussel
0d9bef343b
nixos/thanos: fix services.thanos.receive.labels config 2023-11-12 11:08:51 +01:00
Anthony Roussel
2074409c86
nixos/thanos: add query-frontend SystemD service 2023-11-12 11:08:51 +01:00