summary refs log tree commit diff
path: root/host/Rory-nginx/services/matrix/synapse/workers/federation-sender.nix
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-07-01 18:32:45 +0200
committerRory& <root@rory.gay>2024-07-04 14:45:02 +0200
commitf5d72806b561c041f2dcccfd27aa6691462be32a (patch)
treeec7389c302bda59344bcb5474ae7e960f2ee22ba /host/Rory-nginx/services/matrix/synapse/workers/federation-sender.nix
parentSplit up synapse config (diff)
downloadRory-Open-Architecture-f5d72806b561c041f2dcccfd27aa6691462be32a.tar.xz
Synapse changes for testing
Diffstat (limited to 'host/Rory-nginx/services/matrix/synapse/workers/federation-sender.nix')
-rw-r--r--host/Rory-nginx/services/matrix/synapse/workers/federation-sender.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/host/Rory-nginx/services/matrix/synapse/workers/federation-sender.nix b/host/Rory-nginx/services/matrix/synapse/workers/federation-sender.nix
new file mode 100644
index 0000000..05221de
--- /dev/null
+++ b/host/Rory-nginx/services/matrix/synapse/workers/federation-sender.nix
@@ -0,0 +1,28 @@
+{ config, pkgs, lib, ... }:
+let 
+  cfg = config.services.matrix-synapse;
+  federationSenders = lib.range 0 (cfg.federationSenders - 1);
+in
+{
+  services.matrix-synapse = lib.mkIf (cfg.federationSenders > 0) {
+    settings = {
+      instance_map = lib.listToAttrs (lib.map (index: {
+        name = "federation_sender-${toString index}";
+        value = {
+          path = "/run/synapse/federation_sender-${toString index}.sock";
+        };
+      }) federationSenders);
+
+      send_federation = false;
+      federation_sender_instances = lib.map (index: "federation_sender-${toString index}") federationSenders;
+    };
+
+    workers = lib.listToAttrs (lib.map (index: {
+      name = "federation_sender-${toString index}";
+      value = {
+        worker_app = "synapse.app.generic_worker";
+        worker_listeners = [ ];
+      };
+    }) federationSenders);
+  };
+}
\ No newline at end of file