summary refs log tree commit diff
path: root/host/Rory-nginx/services/matrix/synapse/workers/background.nix
diff options
context:
space:
mode:
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