Commit Graph

1155 Commits

Author SHA1 Message Date
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
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
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
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
Anthony Roussel
e30f48be94
treewide: fix redirected and broken URLs
Using the script in maintainers/scripts/update-redirected-urls.sh
2023-11-11 10:49:01 +01:00
Ryan Lahfa
bc2b72df73
Merge pull request #264234 from guiguid/guiguid-patch-netdata-systemd-journal
netdata: 1.43.0 -> 1.43.2 and add systemd-journal plugin
2023-11-08 13:30:43 +01:00
Felix Buehler
4d1680ccc7 nixos/exportarr: init 2023-11-07 20:56:32 +01:00
Ryan Lahfa
0cd6f66fb7
Merge pull request #247376 from RageKnify/fix/smartd-mail 2023-11-07 18:00:56 +01:00
Maximilian Bosch
dbb68f0b49
Merge pull request #263558 from Ma27/fix-image-renderer-callback
nixos/grafana-image-renderer: use Grafana's http_addr rather than localhost
2023-11-02 15:49:23 +01:00
Anthony Roussel
efdbdab8b5
nixos/ocsinventory-agent: init 2023-11-02 14:20:45 +01:00
Guillaume DELVIT
043522789b nixos/services/netdata: add systemd-journald plugin as a privileged wrapper
https://learn.netdata.cloud/docs/logs/systemd-journal/
need acces to

    Kernel Logs (dmesg):
        Capability: CAP_SYSLOG
        Description: This capability allows the program to read kernel logs using the dmesg command or by reading the /dev/kmsg file.

    System Logs (e.g., /var/log/syslog):
        Capability: CAP_DAC_READ_SEARCH
        Description: This capability allows the program to read system logs located in directories such as /var/log/.

    User Logs (e.g., /var/log/auth.log):
        Capability: CAP_DAC_READ_SEARCH
        Description: This capability allows the program to read user logs located in directories such as /var/log/.
2023-11-01 00:16:30 +01:00
Peder Bergebakken Sundt
37c7104f53
Merge pull request #262915 from chayleaf/certspotter
certspotter: init at 0.17.0; nixos/certspotter: init
2023-10-29 05:10:04 +01:00
Linus Heckemann
8670794565
Merge pull request #263203 from nikstur/replace-activation
Replace simple activationScripts
2023-10-28 10:17:15 +02:00
chayleaf
f4aeeb9e81
nixos/certspotter: init 2023-10-28 14:19:36 +07:00
Anthony Roussel
3a2d3bc3d8
nixos/goss: init 2023-10-27 08:00:48 +02:00
Maximilian Bosch
15e17917fc
nixos/grafana-image-renderer: use Grafana's http_addr rather than localhost
Otherwise the callback won't work Grafana is configured to listen on a
different IP address by default.
2023-10-26 12:57:39 +02:00
nikstur
1b2b1364de nixos/ups: replace activationScript via tmpfiles 2023-10-25 23:44:01 +02:00