about summary refs log tree commit diff
path: root/ops/nixos/whitby
diff options
context:
space:
mode:
Diffstat (limited to 'ops/nixos/whitby')
-rw-r--r--ops/nixos/whitby/default.nix28
1 files changed, 27 insertions, 1 deletions
diff --git a/ops/nixos/whitby/default.nix b/ops/nixos/whitby/default.nix
index a56f43786fe7..075e9505dcee 100644
--- a/ops/nixos/whitby/default.nix
+++ b/ops/nixos/whitby/default.nix
@@ -217,9 +217,35 @@ in lib.fix(self: {
     sourcegraph.enable = true;
 
     # Run the Panettone issue tracker
-    panettone.enable = true;
+    panettone = {
+      enable = true;
+      dbUser = "panettone";
+      dbName = "panettone";
+    };
+  };
+
+  services.postgresql = {
+    enable = true;
+    enableTCPIP = true;
+
+    authentication = lib.mkOverride 10 ''
+      local all all trust
+      host all all ::1/128 trust
+    '';
+
+    ensureDatabases = [
+      "panettone"
+    ];
+
+    ensureUsers = [{
+      name = "panettone";
+      ensurePermissions = {
+        "DATABASE panettone" = "ALL PRIVILEGES";
+      };
+    }];
   };
 
+
   environment.systemPackages = with nixpkgs; [
     bb
     curl