{ appConfig, lib, ... }: lib.mkMerge [ { services.grafana.enable = true; services.grafana.settings.security.disable_initial_admin_creation = true; services.grafana.settings.server.domain = appConfig.domain; services.grafana.settings.server.http_addr = "[::0]"; } { services.prometheus.enable = true; services.prometheus.exporters.systemd.enable = true; services.prometheus.scrapeConfigs = [ { job_name = "systemd"; static_configs = [{ targets = [ "[::1]:9558" ]; }]; } ]; } { services.grafana.settings."auth.proxy".auto_sign_up = true; services.grafana.settings."auth.proxy".enabled = true; services.grafana.settings."auth.proxy".header_name = "Remote-User"; services.grafana.settings."auth.proxy".headers = lib.concatStringsSep " " [ "Email:Remote-Email" "Name:Remote-Name" "Role:Remote-Role" ]; services.grafana.settings."users".allow_sign_up = false; } { services.grafana.provision.datasources.settings.datasources = [ { name = "Prometheus"; type = "prometheus"; url = "http://[23::1]:9090"; } ]; } ]