This repository has been archived on 2024-08-30. You can view files and clone it, but cannot push or open issues or pull requests.
infrastructure/hosts/pink/services/monitoring/grafana.nix

35 lines
779 B
Nix
Raw Normal View History

2024-05-29 17:15:20 +02:00
{ pkgs, config, ... }:
let
grafanaPort = 3033;
in
{
services.grafana = {
enable = true;
settings.server = {
http_port = grafanaPort;
http_addr = "0.0.0.0";
};
provision = {
enable = true;
datasources.settings.datasources = [
{
name = "prometheus";
type = "prometheus";
url = "http://127.0.0.1:${toString config.services.prometheus.port}";
isDefault = true;
}
# {
# name = "loki";
# type = "loki";
# url = "http://127.0.0.1:${toString config.services.loki.configuration.server.http_listen_port}";
# }
2024-05-29 17:15:20 +02:00
];
};
};
networking.firewall = {
allowedTCPPorts = [ grafanaPort ];
allowedUDPPorts = [ grafanaPort ];
};
}