]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Fix netdata stream for eldiron
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 28 Mar 2021 16:39:14 +0000 (18:39 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 28 Mar 2021 16:39:14 +0000 (18:39 +0200)
modules/private/system/eldiron.nix

index 2475710771ffd778246bfe98d06e3373cdb98c70..fdc3692f0cc404376b20fe9419a86abaa864f14d 100644 (file)
   services.netdata.config.global."memory mode" = "none";
   services.netdata.config.health."enabled" = "no";
   services.netdata.config.web.mode = "none";
-  environment.etc."netdata/stream.conf".text = ''
-    [stream]
-        enabled = yes
-        destination = ${config.myEnv.monitoring.netdata_aggregator}
-        api key = ${config.myEnv.monitoring.netdata_keys.eldiron}
-  '';
+  users.users."${config.services.netdata.user}".extraGroups = [ "keys" ];
+  environment.etc."netdata/stream.conf".source = "/var/secrets/netdata-stream.conf";
   secrets.keys = [
+    {
+      dest = "netdata-stream.conf";
+      user = config.services.netdata.user;
+      group = config.services.netdata.group;
+      permissions = "0400";
+      text = ''
+        [stream]
+            enabled = yes
+            destination = ${config.myEnv.monitoring.netdata_aggregator}
+            api key = ${config.myEnv.monitoring.netdata_keys.eldiron}
+      '';
+    }
     {
       dest = "zrepl_backup/identity";
       user = "root";