dotfiles/modules/nixos/services/grafana.nix

28 lines
587 B
Nix
Raw Normal View History

{ config, lib, ... }: {
config = lib.mkIf config.services.grafana.enable {
2023-07-04 23:15:04 +00:00
services.grafana.settings.server = {
2023-07-07 16:16:07 +00:00
domain = config.hostnames.metrics;
2023-07-04 23:05:56 +00:00
http_addr = "127.0.0.1";
http_port = 3000;
2023-07-04 23:15:04 +00:00
protocol = "http";
2023-07-04 23:05:56 +00:00
};
caddy.routes = [{
2023-07-07 16:16:07 +00:00
match = [{ host = [ config.hostnames.metrics ]; }];
handle = [{
handler = "reverse_proxy";
2023-07-16 13:50:58 +00:00
upstreams = [{
dial = "localhost:${
builtins.toString
config.services.grafana.settings.server.http_port
}";
}];
}];
}];
};
}