inputs: { config, ... }: { services.prometheus = { enable = true; listenAddress = "127.0.0.1"; retentionTime = "15w"; scrapeConfigs = [ { job_name = "prometheus"; static_configs = [ { targets = [ "localhost:${toString config.services.prometheus.port}" ]; } ]; } { job_name = "grafana"; static_configs = [ { targets = [ "localhost:${toString config.services.grafana.settings.server.http_port}" ]; } ]; } ]; }; services.grafana = { enable = true; settings = { server.http_addr = config.topology.mainVpn.currentNodeIP; server.http_port = 3001; analytics.reporting_enabled = false; }; }; networking.firewall.interfaces.${config.topology.mainVpn.interfaceName}.allowedTCPPorts = [ config.services.grafana.settings.server.http_port ]; }