nixos/system/services/grafana.nix

37 lines
833 B
Nix

{ ... }:
{
imports = [ ./caddy.nix ];
services.grafana = {
enable = true;
settings = {
server = {
http_addr = "127.0.0.1";
http_port = 3000;
domain = "grafana.xenia.me.uk";
};
};
};
services.prometheus = rec {
enable = true;
port = 9001;
exporters = {
node = {
enable = true;
enabledCollectors = [ "systemd" ];
port = 9002;
};
};
scrapeConfigs = [
{
job_name = "legion";
static_configs = [ { targets = [ "127.0.0.1:${toString exporters.node.port}" ]; } ];
}
# {
# job_name = "minecraft";
# static_configs = [{targets = ["127.0.0.1:8000"];}];
# }
];
};
services.caddy.virtualHosts."grafana.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:3000";
}