nixos/system/services/grafana.nix

37 lines
833 B
Nix
Raw Normal View History

2024-07-30 15:06:34 +01:00
{ ... }:
{
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;
2024-07-30 15:06:34 +01:00
enabledCollectors = [ "systemd" ];
port = 9002;
};
};
2024-01-30 14:21:50 +00:00
scrapeConfigs = [
{
job_name = "legion";
2024-07-30 15:06:34 +01:00
static_configs = [ { targets = [ "127.0.0.1:${toString exporters.node.port}" ]; } ];
2024-01-30 14:21:50 +00:00
}
2024-02-21 12:31:26 +00:00
# {
# job_name = "minecraft";
# static_configs = [{targets = ["127.0.0.1:8000"];}];
# }
2024-01-30 14:21:50 +00:00
];
};
2024-01-30 14:21:50 +00:00
services.caddy.virtualHosts."grafana.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:3000";
}