};
};
- services.netdata.enable = true;
- services.netdata.config.global."memory mode" = "none";
- services.netdata.config.health."enabled" = "no";
- services.netdata.config.web.mode = "none";
- users.users."${config.services.netdata.user}".extraGroups = [ "keys" ];
- services.netdata.configDir."stream.conf" = config.secrets.fullPaths."netdata-stream.conf";
secrets.keys = {
"ldap/pam_pgsql" = {
user = "root";
'';
};
- "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}
- '';
- };
"zrepl_backup/identity" = {
user = "root";
group = "root";
})
];
- services.netdata.enable = true;
- services.netdata.configDir."stream.conf" = config.secrets.fullPaths."netdata-stream.conf";
- services.netdata.config.web."allow dashboard from" = "localhost";
- services.netdata.config.web."allow badges from" = "*";
- services.netdata.config.web."allow streaming from" = "*";
- services.netdata.config.web."allow netdata.conf from" = "fd*";
- services.netdata.config.web."allow management from" = "fd*";
- networking.firewall.allowedTCPPorts = [ 19999 ];
-
- secrets.keys = {
- "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
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedProxySettings = true;
- upstreams."netdata".servers = { "127.0.0.1:19999" = {}; };
- upstreams."netdata".extraConfig = ''
- keepalive 64;
- '';
virtualHosts."status.immae.eu" = {
acmeRoot = config.security.acme.defaults.webroot;
useACMEHost = name;
forceSSL = true;
locations."/".proxyPass = "http://unix:/run/naemon-status/socket.sock:/";
-
- locations."= /netdata".return = "301 /netdata/";
- locations."~ /netdata/(?<ndpath>.*)".extraConfig = ''
- proxy_redirect off;
- proxy_set_header Host $host;
-
- proxy_set_header X-Forwarded-Host $host;
- proxy_set_header X-Forwarded-Server $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_http_version 1.1;
- proxy_pass_request_headers on;
- proxy_set_header Connection "keep-alive";
- proxy_store off;
- proxy_pass http://netdata/$ndpath$is_args$args;
-
- gzip on;
- gzip_proxied any;
- gzip_types *;
- '';
};
};
security.acme.certs."${name}" = {