summary refs log tree commit diff stats
path: root/system/services
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-07-27 10:12:00 +0200
committerSoispha <soispha@vhack.eu>2023-07-27 10:12:00 +0200
commit911c3a166b08e2a6a4864980fa197b04cba83fa7 (patch)
treed2821f9e7b5f69856a3cb52dfff6b932e2ccdb1c /system/services
parentFix(system/services/matrix/bridges/m-wa): Correct postgresql uri (diff)
downloadnixos-server-911c3a166b08e2a6a4864980fa197b04cba83fa7.tar.gz
nixos-server-911c3a166b08e2a6a4864980fa197b04cba83fa7.zip
Fix(system/services/matrix/bridges/m-wa): Use own database
Diffstat (limited to '')
-rw-r--r--system/services/matrix/default.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/system/services/matrix/default.nix b/system/services/matrix/default.nix
index b0219ef..ed3b567 100644
--- a/system/services/matrix/default.nix
+++ b/system/services/matrix/default.nix
@@ -20,11 +20,19 @@ in {
 
   services.postgresql.enable = true;
   services.postgresql.initialScript = pkgs.writeText "synapse-init.sql" ''
+    --Matrix:
     CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse';
     CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse"
       TEMPLATE template0
       LC_COLLATE = "C"
       LC_CTYPE = "C";
+
+    --Whatsapp-bridge:
+    CREATE ROLE "mautrix-whatsapp" WITH LOGIN PASSWORD 'whatsapp';
+    CREATE DATABASE "mautrix-whatsapp" WITH OWNER "mautrix-whatsapp"
+      TEMPLATE template0
+      LC_COLLATE = "C"
+      LC_CTYPE = "C";
   '';
 
   services.nginx = {
@@ -62,7 +70,7 @@ in {
       appservice = {
         database = {
           type = "postgres";
-          uri = "postgres:///matrix-synapse?host=/run/postgresql";
+          uri = "postgres:///mautrix-whatsapp?host=/run/postgresql";
         };
         whatsapp = {
           # TODO: See https://github.com/tulir/whatsmeow/blob/efc632c008604016ddde63bfcfca8de4e5304da9/binary/proto/def.proto#L43-L64 for a list.