diff options
author | Lassulus <github@lassul.us> | 2024-01-26 10:47:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-26 10:47:18 +0100 |
commit | da25b2382decfe23df6a4b8e284f524c6baec78f (patch) | |
tree | 258f99c4f322eca79f1e85b6be6a0881a8039b5e /nixos/modules/services/monitoring | |
parent | 4c2c00adb9e03df33bccd6609b42cbf34ce5f09b (diff) | |
parent | f5d513c5738e630bb053f897b789801bff078ec9 (diff) | |
download | nixlib-da25b2382decfe23df6a4b8e284f524c6baec78f.tar nixlib-da25b2382decfe23df6a4b8e284f524c6baec78f.tar.gz nixlib-da25b2382decfe23df6a4b8e284f524c6baec78f.tar.bz2 nixlib-da25b2382decfe23df6a4b8e284f524c6baec78f.tar.lz nixlib-da25b2382decfe23df6a4b8e284f524c6baec78f.tar.xz nixlib-da25b2382decfe23df6a4b8e284f524c6baec78f.tar.zst nixlib-da25b2382decfe23df6a4b8e284f524c6baec78f.zip |
Merge pull request #280373 from h7x4/treewide-use-new-tmpfiles-api
treewide: use new tmpfiles API
Diffstat (limited to 'nixos/modules/services/monitoring')
-rw-r--r-- | nixos/modules/services/monitoring/alerta.nix | 7 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/kapacitor.nix | 6 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/munin.nix | 24 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/osquery.nix | 8 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/riemann-dash.nix | 7 |
5 files changed, 33 insertions, 19 deletions
diff --git a/nixos/modules/services/monitoring/alerta.nix b/nixos/modules/services/monitoring/alerta.nix index 6c7ebec4191c..0b0ab177e5e1 100644 --- a/nixos/modules/services/monitoring/alerta.nix +++ b/nixos/modules/services/monitoring/alerta.nix @@ -79,9 +79,10 @@ in }; config = mkIf cfg.enable { - systemd.tmpfiles.rules = [ - "d '${cfg.logDir}' - alerta alerta - -" - ]; + systemd.tmpfiles.settings."10-alerta".${cfg.logDir}.d = { + user = "alerta"; + group = "alerta"; + }; systemd.services.alerta = { description = "Alerta Monitoring System"; diff --git a/nixos/modules/services/monitoring/kapacitor.nix b/nixos/modules/services/monitoring/kapacitor.nix index 727b694047b4..c90878656899 100644 --- a/nixos/modules/services/monitoring/kapacitor.nix +++ b/nixos/modules/services/monitoring/kapacitor.nix @@ -160,9 +160,9 @@ in config = mkIf cfg.enable { environment.systemPackages = [ pkgs.kapacitor ]; - systemd.tmpfiles.rules = [ - "d '${cfg.dataDir}' - ${cfg.user} ${cfg.group} - -" - ]; + systemd.tmpfiles.settings."10-kapacitor".${cfg.dataDir}.d = { + inherit (cfg) user group; + }; systemd.services.kapacitor = { description = "Kapacitor Real-Time Stream Processing Engine"; diff --git a/nixos/modules/services/monitoring/munin.nix b/nixos/modules/services/monitoring/munin.nix index 5ed7cac48ae7..456a14169b95 100644 --- a/nixos/modules/services/monitoring/munin.nix +++ b/nixos/modules/services/monitoring/munin.nix @@ -374,7 +374,11 @@ in }; # munin_stats plugin breaks as of 2.0.33 when this doesn't exist - systemd.tmpfiles.rules = [ "d /run/munin 0755 munin munin -" ]; + systemd.tmpfiles.settings."10-munin"."/run/munin".d = { + mode = "0755"; + user = "munin"; + group = "munin"; + }; }) (mkIf cronCfg.enable { @@ -399,11 +403,17 @@ in }; }; - systemd.tmpfiles.rules = [ - "d /run/munin 0755 munin munin -" - "d /var/log/munin 0755 munin munin -" - "d /var/www/munin 0755 munin munin -" - "d /var/lib/munin 0755 munin munin -" - ]; + systemd.tmpfiles.settings."20-munin" = let + defaultConfig = { + mode = "0755"; + user = "munin"; + group = "munin"; + }; + in { + "/run/munin".d = defaultConfig; + "/var/log/munin".d = defaultConfig; + "/var/www/munin".d = defaultConfig; + "/var/lib/munin".d = defaultConfig; + }; })]; } diff --git a/nixos/modules/services/monitoring/osquery.nix b/nixos/modules/services/monitoring/osquery.nix index 4f6c2557a641..86ef3fc73213 100644 --- a/nixos/modules/services/monitoring/osquery.nix +++ b/nixos/modules/services/monitoring/osquery.nix @@ -90,8 +90,10 @@ in }; wantedBy = [ "multi-user.target" ]; }; - systemd.tmpfiles.rules = [ - "d ${dirname (cfg.flags.pidfile)} 0755 root root -" - ]; + systemd.tmpfiles.settings."10-osquery".${dirname (cfg.flags.pidfile)}.d = { + user = "root"; + group = "root"; + mode = "0755"; + }; }; } diff --git a/nixos/modules/services/monitoring/riemann-dash.nix b/nixos/modules/services/monitoring/riemann-dash.nix index 1ca8af14e777..1622d7a9b920 100644 --- a/nixos/modules/services/monitoring/riemann-dash.nix +++ b/nixos/modules/services/monitoring/riemann-dash.nix @@ -59,9 +59,10 @@ in { group = "riemanndash"; }; - systemd.tmpfiles.rules = [ - "d '${cfg.dataDir}' - riemanndash riemanndash - -" - ]; + systemd.tmpfiles.settings."10-riemanndash".${cfg.dataDir}.d = { + user = "riemanndash"; + group = "riemanndash"; + }; systemd.services.riemann-dash = { wantedBy = [ "multi-user.target" ]; |