summary refs log tree commit diff
path: root/host/Rory-nginx/services/matrix/synapse/_synapse.monolith.nix
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-07-04 14:59:36 +0200
committerRory& <root@rory.gay>2024-07-04 14:59:36 +0200
commitdd7b872694441a96b8b042ccbc4b63a96d0b89b9 (patch)
tree76a25875e08415c38cdb7b5ad8f93241b387d078 /host/Rory-nginx/services/matrix/synapse/_synapse.monolith.nix
parentUpdate flake inputs (diff)
downloadRory-Open-Architecture-dd7b872694441a96b8b042ccbc4b63a96d0b89b9.tar.xz
Nixfmt
Diffstat (limited to 'host/Rory-nginx/services/matrix/synapse/_synapse.monolith.nix')
-rwxr-xr-xhost/Rory-nginx/services/matrix/synapse/_synapse.monolith.nix96
1 files changed, 54 insertions, 42 deletions
diff --git a/host/Rory-nginx/services/matrix/synapse/_synapse.monolith.nix b/host/Rory-nginx/services/matrix/synapse/_synapse.monolith.nix
index 26c61a1..8bdaf19 100755
--- a/host/Rory-nginx/services/matrix/synapse/_synapse.monolith.nix
+++ b/host/Rory-nginx/services/matrix/synapse/_synapse.monolith.nix
@@ -1,4 +1,9 @@
-{ config, pkgs, lib, ... }:
+{
+  config,
+  pkgs,
+  lib,
+  ...
+}:
 
 {
   services.matrix-synapse = {
@@ -25,7 +30,7 @@
         max_long_retry_delay = "30s";
       };
 
-      event_cache_size = "1200K"; #defaults to 10K
+      event_cache_size = "1200K"; # defaults to 10K
       caches = {
         global_factor = 5000.0;
         cache_entry_ttl = "12h";
@@ -41,18 +46,26 @@
       # Alicia - figure this out later...
       #registration_shared_secret = builtins.exec ["cat" "/dev/urandom" "|" "tr" "-dc" "a-zA-Z0-9" "|" "fold" "-w" "256" "|" "head" "-n" "1"];
       registration_shared_secret_path = "/var/lib/matrix-synapse/registration_shared_secret.txt";
-      
+
       listeners = [
-        { 
+        {
           port = 8008;
-          bind_addresses = [ "192.168.1.2" "127.0.0.1" ];
+          bind_addresses = [
+            "192.168.1.2"
+            "127.0.0.1"
+          ];
           type = "http";
           tls = false;
           x_forwarded = true;
-          resources = [ {
-            names = [ "client" "federation" ];
-            compress = true;
-          } ];
+          resources = [
+            {
+              names = [
+                "client"
+                "federation"
+              ];
+              compress = true;
+            }
+          ];
         }
       ];
       dynamic_thumbnails = true;
@@ -171,42 +184,41 @@
     plugins = with pkgs.matrix-synapse-plugins; [
       # Alicia - need to port draupnir...
       #matrix-synapse-mjolnir-antispam
-#      matrix-synapse-pam
+      #      matrix-synapse-pam
     ];
-#    extraConfigFiles = [
-#        (pkgs.writeTextFile {
-#          name = "matrix-synapse-extra-config.yml";
-#          text = ''
-#            modules:
-#              - module: "pam_auth_provider.PAMAuthProvider"
-#                config:
-#                  create_users: true
-#                  skip_user_check: false
-#          '';
-#        })
-#      ];
+    #    extraConfigFiles = [
+    #        (pkgs.writeTextFile {
+    #          name = "matrix-synapse-extra-config.yml";
+    #          text = ''
+    #            modules:
+    #              - module: "pam_auth_provider.PAMAuthProvider"
+    #                config:
+    #                  create_users: true
+    #                  skip_user_check: false
+    #          '';
+    #        })
+    #      ];
   };
 
-    systemd.services.matrix-synapse-reg-token = {
-      description = "Random registration token for Synapse.";
-      before = ["matrix-synapse.service"]; # So the registration can be used by Synapse
-      wantedBy = ["multi-user.target"];
-      after = ["network.target"];
-
-      script = ''
-
-        if [ ! -f "registration_shared_secret.txt" ]
-        then
-          cat /dev/urandom | tr -dc a-zA-Z0-9 | fold -w 256 | head -n 1 > registration_shared_secret.txt
-        else
-          echo Not generating key, key exists;
-        fi'';
-      serviceConfig = {
-        User = "matrix-synapse";
-        Group = "matrix-synapse";
-        WorkingDirectory = "/var/lib/matrix-synapse";
-      };
+  systemd.services.matrix-synapse-reg-token = {
+    description = "Random registration token for Synapse.";
+    before = [ "matrix-synapse.service" ]; # So the registration can be used by Synapse
+    wantedBy = [ "multi-user.target" ];
+    after = [ "network.target" ];
+
+    script = ''
+
+      if [ ! -f "registration_shared_secret.txt" ]
+      then
+        cat /dev/urandom | tr -dc a-zA-Z0-9 | fold -w 256 | head -n 1 > registration_shared_secret.txt
+      else
+        echo Not generating key, key exists;
+      fi'';
+    serviceConfig = {
+      User = "matrix-synapse";
+      Group = "matrix-synapse";
+      WorkingDirectory = "/var/lib/matrix-synapse";
     };
+  };
 
 }
-