summary refs log tree commit diff
path: root/host/Rory-nginx/services/matrix/synapse/workers/background.nix
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-07-04 00:47:48 +0200
committerRory& <root@rory.gay>2024-07-04 14:45:02 +0200
commit983815864d6d052b3d46685feea02959e4b2238b (patch)
tree2a24ffa9e0c33f62d634ffb102937ea1cba1a36b /host/Rory-nginx/services/matrix/synapse/workers/background.nix
parentSynapse main cleanup (diff)
downloadRory-Open-Architecture-983815864d6d052b3d46685feea02959e4b2238b.tar.xz
Synapse workers work
Diffstat (limited to 'host/Rory-nginx/services/matrix/synapse/workers/background.nix')
-rw-r--r--host/Rory-nginx/services/matrix/synapse/workers/background.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/host/Rory-nginx/services/matrix/synapse/workers/background.nix b/host/Rory-nginx/services/matrix/synapse/workers/background.nix
new file mode 100644
index 0000000..d267124
--- /dev/null
+++ b/host/Rory-nginx/services/matrix/synapse/workers/background.nix
@@ -0,0 +1,36 @@
+{ config, pkgs, lib, ... }:
+
+let 
+  cfg = config.services.matrix-synapse;
+in
+{
+  services.matrix-synapse = lib.mkIf cfg.enableBackgroundWorker {
+    settings = {
+      instance_map = {
+        appservice = {
+          path = "/run/matrix-synapse/background.sock";
+        };
+      };
+
+      run_background_tasks_on = "background";
+    };
+
+    workers = {
+      appservice = {
+        worker_app = "synapse.app.generic_worker";
+        worker_listeners = [
+          {
+            type = "http";
+            path = "/run/matrix-synapse/background.sock";
+            resources = [
+              {
+                names = ["replication"];
+                compress = false;
+              }
+            ];
+          }
+        ];
+      };
+    };
+  };
+}
\ No newline at end of file