]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Remove netdata stream key from the store
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 29 Jan 2021 15:33:03 +0000 (16:33 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 29 Jan 2021 15:33:03 +0000 (16:33 +0100)
modules/private/system/monitoring-1.nix
nixops/secrets

index 188162ac99605efff4e04725ee6cfb63778a9d98..2198d09fc3f480b7045284d3f2019ff1c3ff4a91 100644 (file)
   services.netdata.config.web."allow netdata.conf from" = "fd*";
   services.netdata.config.web."allow management from" = "fd*";
   networking.firewall.allowedTCPPorts = [ 19999 ];
-  environment.etc."netdata/stream.conf".text = builtins.concatStringsSep "\n" (pkgs.lib.mapAttrsToList (_: key: ''
-    [${key}]
-        enabled = yes
-        default history = 3600
-        default memory = ram
-        health enabled by default = auto
-  '') config.myEnv.monitoring.netdata_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 = builtins.concatStringsSep "\n" (pkgs.lib.mapAttrsToList (_: key: ''
+        [${key}]
+            enabled = yes
+            default history = 3600
+            default memory = ram
+            health enabled by default = auto
+      '') config.myEnv.monitoring.netdata_keys);
+    }
+  ];
+  users.users."${config.services.netdata.user}".extraGroups = [ "keys" ];
   # This value determines the NixOS release with which your system is
   # to be compatible, in order to avoid breaking some software such as
   # database servers. You should change this only after NixOS release
index 252f7ed22d97d82902ff2d9fedccc525d67cabcb..3c9ed734ef4d9bc58d7f0b79d86253a8163d06f0 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 252f7ed22d97d82902ff2d9fedccc525d67cabcb
+Subproject commit 3c9ed734ef4d9bc58d7f0b79d86253a8163d06f0