diff options
Diffstat (limited to 'nixos/hosts/tente/matrix.nix')
-rw-r--r-- | nixos/hosts/tente/matrix.nix | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/nixos/hosts/tente/matrix.nix b/nixos/hosts/tente/matrix.nix index b60f3cd..ab6931e 100644 --- a/nixos/hosts/tente/matrix.nix +++ b/nixos/hosts/tente/matrix.nix @@ -5,6 +5,9 @@ let in { options.matrix = { + port = lib.mkOption { + type = lib.types.int; + }; serverName = lib.mkOption { type = lib.types.str; }; @@ -19,6 +22,24 @@ in enable = true; settings = { server_name = cfg.serverName; + listeners = [{ + # This listener matches the default of NixOS 24.11 (replicated here to make the port configurable). + bind_addresses = ["127.0.0.1"]; + port = cfg.port; + resources = [ + { + compress = true; + names = ["client"]; + } + { + compress = false; + names = ["federation"]; + } + ]; + tls = false; + type = "http"; + x_forwarded = true; + }]; }; }; @@ -30,9 +51,9 @@ in # Forward all Matrix API calls to the synapse Matrix homeserver. A trailing slash # *must not* be used here. - locations."/_matrix".proxyPass = "http://127.0.0.1:8008"; + locations."/_matrix".proxyPass = "http://127.0.0.1:${toString cfg.port}"; # Forward requests for e.g. SSO and password-resets. - locations."/_synapse/client".proxyPass = "http://127.0.0.1:8008"; + locations."/_synapse/client".proxyPass = "http://127.0.0.1:${toString cfg.port}"; }; }; }; |