nixos/system/services/grafana.nix
Evie Litherland-Smith 763a1d2a05 Merge home-manager config back in to nixos config
Place home-manager config under home directory, move system config
under system directory.

Add hostname-specific entries under home directory to be consistent
with how system is configured, update flake accordingly
2024-07-03 07:15:39 +01:00

36 lines
821 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";
}