nixos/services/grafana.nix

32 lines
709 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}" ]; }];
}];
};
services.caddy.virtualHosts."grafana.xenia.me.uk".extraConfig =
"reverse_proxy http://localhost:3000";
}