summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2022-02-08 04:54:24 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2022-03-04 23:57:30 +0100
commitf8fff1c1a61a105d7bc8cce9b5cf55d99ce27db2 (patch)
tree32bc3a1f238daa2783af991397279599e774b74b /nixos/tests
parentd91801188506affd3b62bb9115ff07d6d3fb2232 (diff)
downloadnixpkgs-f8fff1c1a61a105d7bc8cce9b5cf55d99ce27db2.tar
nixpkgs-f8fff1c1a61a105d7bc8cce9b5cf55d99ce27db2.tar.gz
nixpkgs-f8fff1c1a61a105d7bc8cce9b5cf55d99ce27db2.tar.bz2
nixpkgs-f8fff1c1a61a105d7bc8cce9b5cf55d99ce27db2.tar.lz
nixpkgs-f8fff1c1a61a105d7bc8cce9b5cf55d99ce27db2.tar.xz
nixpkgs-f8fff1c1a61a105d7bc8cce9b5cf55d99ce27db2.tar.zst
nixpkgs-f8fff1c1a61a105d7bc8cce9b5cf55d99ce27db2.zip
nixos/tests/matrix-synapse: use settings option
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/matrix-synapse.nix64
1 files changed, 46 insertions, 18 deletions
diff --git a/nixos/tests/matrix-synapse.nix b/nixos/tests/matrix-synapse.nix
index 21e8c24e471..1ff1e47b284 100644
--- a/nixos/tests/matrix-synapse.nix
+++ b/nixos/tests/matrix-synapse.nix
@@ -33,6 +33,29 @@ import ./make-test-python.nix ({ pkgs, ... } : let
   testUser = "alice";
   testPassword = "alicealice";
   testEmail = "alice@example.com";
+
+  listeners = [ {
+    port = 8448;
+    bind_addresses = [
+      "127.0.0.1"
+      "::1"
+    ];
+    type = "http";
+    tls = true;
+    x_forwarded = false;
+    resources = [ {
+      names = [
+        "client"
+      ];
+      compress = true;
+    } {
+      names = [
+        "federation"
+      ];
+      compress = false;
+    } ];
+  } ];
+
 in {
 
   name = "matrix-synapse";
@@ -48,22 +71,24 @@ in {
     {
       services.matrix-synapse = {
         enable = true;
-        database_type = "psycopg2";
-        tls_certificate_path = "${cert}";
-        tls_private_key_path = "${key}";
-        database_args = {
-          password = "synapse";
+        settings = {
+          inherit listeners;
+          database = {
+            name = "psycopg2";
+            args.password = "synapse";
+          };
+          tls_certificate_path = "${cert}";
+          tls_private_key_path = "${key}";
+          registration_shared_secret = registrationSharedSecret;
+          public_baseurl = "https://example.com";
+          email = {
+            smtp_host = mailerDomain;
+            smtp_port = 25;
+            require_transport_security = true;
+            notif_from = "matrix <matrix@${mailerDomain}>";
+            app_name = "Matrix";
+          };
         };
-        registration_shared_secret = registrationSharedSecret;
-        public_baseurl = "https://example.com";
-        extraConfig = ''
-          email:
-            smtp_host: "${mailerDomain}"
-            smtp_port: 25
-            require_transport_security: true
-            notif_from: "matrix <matrix@${mailerDomain}>"
-            app_name: "Matrix"
-        '';
       };
       services.postgresql = {
         enable = true;
@@ -165,9 +190,12 @@ in {
     serversqlite = args: {
       services.matrix-synapse = {
         enable = true;
-        database_type = "sqlite3";
-        tls_certificate_path = "${cert}";
-        tls_private_key_path = "${key}";
+        settings = {
+          inherit listeners;
+          database.name = "sqlite3";
+          tls_certificate_path = "${cert}";
+          tls_private_key_path = "${key}";
+        };
       };
     };
   };