mirror of
https://git.gay/xqtc/nixos-config
synced 2024-11-29 19:33:54 +01:00
48 lines
1,009 B
Nix
48 lines
1,009 B
Nix
{
|
|
config,
|
|
pkgs,
|
|
...
|
|
}: {
|
|
networking.firewall.allowedTCPPorts = [80 443 9001];
|
|
services.grafana = {
|
|
enable = true;
|
|
settings.server = {
|
|
domain = "grafana.fritz.box";
|
|
port = 2342;
|
|
addr = "127.0.0.1";
|
|
};
|
|
};
|
|
|
|
services.prometheus = {
|
|
enable = true;
|
|
port = 9001;
|
|
exporters = {
|
|
node = {
|
|
enable = true;
|
|
enabledCollectors = ["systemd" "sysctl" "powersupplyclass"];
|
|
port = 9002;
|
|
};
|
|
};
|
|
scrapeConfigs = [
|
|
{
|
|
job_name = "seraphim";
|
|
static_configs = [
|
|
{
|
|
targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"];
|
|
}
|
|
];
|
|
}
|
|
];
|
|
};
|
|
|
|
services.nginx.virtualHosts.${config.services.grafana.settings.server.domain} = {
|
|
locations."/" = {
|
|
extraConfig = ''
|
|
proxy_set_header Host $host;
|
|
'';
|
|
proxyPass = "http://127.0.0.1:${toString config.services.grafana.port}";
|
|
proxyWebsockets = true;
|
|
};
|
|
};
|
|
}
|