diff options
Diffstat (limited to 'apps/grafana/module.nix')
-rw-r--r-- | apps/grafana/module.nix | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/apps/grafana/module.nix b/apps/grafana/module.nix new file mode 100644 index 0000000..8f2a365 --- /dev/null +++ b/apps/grafana/module.nix @@ -0,0 +1,35 @@ +{ 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"; + } + ]; + } +] |