about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2024-06-02 19:33:03 +0900
committersefidel <contact@sefidel.net>2024-06-15 11:57:35 +0900
commit6abbff704baa8f87625db730fbd45a169936d527 (patch)
tree41e4c9a445c040d562e1b5140bede11f5b051dde
parentb741e908a3b8a2f37261c1d87d18ed5f3df7323b (diff)
downloadinfra-6abbff704baa8f87625db730fbd45a169936d527.tar.gz
infra-6abbff704baa8f87625db730fbd45a169936d527.zip
fix(modules/matrix-bridge): fixup matrix-discord-appservice
-rw-r--r--modules/services/matrix-bridge/default.nix17
1 files changed, 15 insertions, 2 deletions
diff --git a/modules/services/matrix-bridge/default.nix b/modules/services/matrix-bridge/default.nix
index 9668336..6fb0cd2 100644
--- a/modules/services/matrix-bridge/default.nix
+++ b/modules/services/matrix-bridge/default.nix
@@ -353,7 +353,7 @@ in
         # };
         auth.usePrivilegedIntents = true;
         database = {
-          connString = "postgresql://matrix-appservice-discord?host=/run/postgresql";
+          connString = "postgresql:///matrix-appservice-discord?host=/run/postgresql";
           filename = "";
         };
 
@@ -372,6 +372,19 @@ in
       @system-service @pkey ~@privileged @resources @chown
     '';
 
+    systemd.services.matrix-appservice-discord.serviceConfig = {
+      DynamicUser = lib.mkForce false;
+      PrivateTmp = lib.mkForce false;
+      User = "matrix-appservice-discord";
+      Group = "matrix-appservice-discord";
+    };
+
+    users.groups.matrix-appservice-discord = {};
+    users.users.matrix-appservice-discord = {
+      description = "Service user for the Matrix-Discord bridge";
+      group = "matrix-appservice-discord";
+      isSystemUser = true;
+    };
 
     modules.persistence.directories = [
       "/var/lib/private/mautrix-telegram"
@@ -426,7 +439,7 @@ in
       "mautrix-discord:/var/lib/mautrix-discord/discord-registration.yaml"
       "double-puppet:${config.sops.templates."double-puppet-registration.yaml".path}"
       "appservice-irc:/var/lib/matrix-appservice-irc/registration.yml"
-      "appservice-discord:/var/lib/private/matrix-appservice-discord/discord-registration.yaml"
+      "appservice-discord:/var/lib/matrix-appservice-discord/discord-registration.yaml"
     ];
 
     services.matrix-synapse.settings.app_service_config_files = [