mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 23:00:14 +01:00
41 lines
907 B
Nix
41 lines
907 B
Nix
|
|
{ config, ... }: {
|
||
|
|
services = {
|
||
|
|
grafana = {
|
||
|
|
enable = true;
|
||
|
|
settings.server = {
|
||
|
|
domain = "monitoring.liv.town";
|
||
|
|
http_addr = "127.0.0.1";
|
||
|
|
http_port = 2342;
|
||
|
|
};
|
||
|
|
};
|
||
|
|
|
||
|
|
nginx.virtualHosts.${config.services.grafana.domain} = {
|
||
|
|
useACMEHost = "liv.town";
|
||
|
|
forceSSL = true;
|
||
|
|
locations."/" = {
|
||
|
|
proxyPass = "http://127.0.0.1:${toString config.services.grafana.port}";
|
||
|
|
proxyWebsockets = true;
|
||
|
|
};
|
||
|
|
};
|
||
|
|
|
||
|
|
prometheus = {
|
||
|
|
enable = true;
|
||
|
|
port = 9001;
|
||
|
|
exporters = {
|
||
|
|
node = {
|
||
|
|
enable = true;
|
||
|
|
enabledCollectors = [ "systemd" ];
|
||
|
|
port = 9002;
|
||
|
|
};
|
||
|
|
};
|
||
|
|
scrapeConfigs = [{
|
||
|
|
job_name = "violet";
|
||
|
|
static_configs = [{
|
||
|
|
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ];
|
||
|
|
}];
|
||
|
|
}];
|
||
|
|
};
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|