summary refs log tree commit diff
path: root/host/Rory-nginx/services/matrix/synapse/workers/pusher.nix
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-08-16 14:39:37 +0200
committerRory& <root@rory.gay>2024-08-16 14:39:37 +0200
commit4a60627f7f5f4e6a64a93635bd0df2c7f6b2cd17 (patch)
tree8159e19ce6762e40f538a9a40f11b05eb4da7d09 /host/Rory-nginx/services/matrix/synapse/workers/pusher.nix
parentUnify single workers (diff)
downloadRory-Open-Architecture-4a60627f7f5f4e6a64a93635bd0df2c7f6b2cd17.tar.xz
Start reworking other workers
Diffstat (limited to 'host/Rory-nginx/services/matrix/synapse/workers/pusher.nix')
-rw-r--r--host/Rory-nginx/services/matrix/synapse/workers/pusher.nix30
1 files changed, 27 insertions, 3 deletions
diff --git a/host/Rory-nginx/services/matrix/synapse/workers/pusher.nix b/host/Rory-nginx/services/matrix/synapse/workers/pusher.nix
index ad0d5d6..64d40b2 100644
--- a/host/Rory-nginx/services/matrix/synapse/workers/pusher.nix
+++ b/host/Rory-nginx/services/matrix/synapse/workers/pusher.nix
@@ -2,11 +2,13 @@
 let
   cfg = config.services.matrix-synapse;
   dbGroup = "small";
-  hasClientResource = false;
-  hasFederationResource = false;
   pushers = lib.range 0 (cfg.pushers - 1);
   workerName = "pusher";
-  workerRoutes = [ ];
+  workerRoutes = {
+    client = [ ];
+    federation = [ ];
+    media = [ ];
+  };
 in
 {
   config = lib.mkIf (cfg.pushers > 0) {
@@ -51,5 +53,27 @@ in
         }) pushers
       );
     };
+
+    services.nginx = {
+      virtualHosts."${cfg.nginxVirtualHostName}".locations = lib.listToAttrs (
+        lib.flatten (
+          lib.forEach
+            [
+              "client"
+              "federation"
+              "media"
+            ]
+            (
+              type:
+              lib.map (route: {
+                name = route;
+                value = {
+                  proxyPass = "http://unix:/run/matrix-synapse/${workerName}-${type}.sock";
+                };
+              }) workerRoutes.${type}
+            )
+        )
+      );
+    };
   };
 }