diff --git a/modules/services/grafana/module.nix b/modules/services/grafana/module.nix index 40e3227..83d5b26 100644 --- a/modules/services/grafana/module.nix +++ b/modules/services/grafana/module.nix @@ -44,7 +44,28 @@ in { check_for_updates = false; }; - # users.allow_signup = false; + users.allow_signup = false; + }; + provision = { + enable = true; + datasources.settings = { + datasources = [ + (mkIf config.modules.system.services.database.postgresql.enable { + name = "Prometheus"; + type = "prometheus"; + access = "proxy"; + url = "http://127.0.0.1:4024"; + isDefault = true; + }) + + (mkIf config.modules.system.services.prometheus.enable { + name = "PostgreSQL"; + type = "postgres"; + access = "proxy"; + url = "http://127.0.0.1:${toString config.services.prometheus.port}"; + }) + ]; + }; }; }; services.nginx = {