Install postgres and dendrite
diff --git a/modules/grafana.nix b/modules/grafana.nix
index 69c231e..6aee70f 100644
--- a/modules/grafana.nix
+++ b/modules/grafana.nix
@@ -1,15 +1,26 @@
-{
+{ lib, config, ... }: {
   services.grafana = {
     enable = true;
 
     settings = {
       server = rec {
         domain = "logs.clicks.codes";
-        root_url ="https://${domain}";
+        root_url = "https://${domain}";
         http_port = 9052;
         enable_gzip = true;
       };
       analytics.reporting_enabled = false;
     };
+
+    provision.datasources.settings.datasources = [{
+      name = "clicks-postgresql";
+      type = "postgres";
+      access = "proxy";
+
+      url = "postgres://localhost:${toString config.services.postgresql.port}";
+      user = "clicks_grafana";
+      password = "$__file{${config.sops.secrets.clicks_grafana_db_password.path}}";
+      # defined in postgres.nix
+    }];
   };
 }