diff --git a/hosts/cube/grafana.nix b/hosts/cube/grafana.nix index 4f7dfa2..a6194e7 100644 --- a/hosts/cube/grafana.nix +++ b/hosts/cube/grafana.nix @@ -30,6 +30,8 @@ in serverSystemConfiguration { settings.security = { admin_email = "metrics@${domain}"; admin_password = "$__file{${config.age.secrets."cube/passowrd.grafana".path}}"; + + disable_initial_admin_creation = true; # Just in case. }; }; diff --git a/hosts/cube/prometheus.nix b/hosts/cube/prometheus.nix index 76f46a8..c510f5e 100644 --- a/hosts/cube/prometheus.nix +++ b/hosts/cube/prometheus.nix @@ -1,11 +1,17 @@ { config, ulib, ... }: with ulib; serverSystemConfiguration { - services.grafana.provision.datasources.settings.datasources = [{ - name = "Prometheus"; - type = "prometheus"; - url = "http://[::]:${toString config.services.prometheus.port}"; - }]; + services.grafana.provision.datasources.settings = { + datasources = [{ + name = "Prometheus"; + type = "prometheus"; + url = "http://[::]:${toString config.services.prometheus.port}"; + }]; + + deleteDatasources = [{ + name = "Prometheus"; + }]; + }; services.prometheus = enabled { port = 9000;