{ 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; } ]; }; }; networking.firewall = { allowedTCPPorts = [ grafanaPort ]; allowedUDPPorts = [ grafanaPort ]; }; }