- 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" ];