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