diff options
author | KJ Ørbekk <kj@orbekk.com> | 2017-05-14 09:40:30 -0400 |
---|---|---|
committer | KJ Ørbekk <kj@orbekk.com> | 2017-05-14 09:40:30 -0400 |
commit | ffb00cd62672c19e875820049b86eb362e6d0775 (patch) | |
tree | b43807493337c0ab58a2f09cc7e401d0b46ae97a | |
parent | 48e728d8bfccc42efd23fa6fe9df420b8f7fc028 (diff) |
Add matrix configuration.
-rw-r--r-- | config/matrix.nix | 37 | ||||
-rw-r--r-- | data/aliases.nix | 2 | ||||
-rw-r--r-- | machines/container-shape.nix | 1 |
3 files changed, 40 insertions, 0 deletions
diff --git a/config/matrix.nix b/config/matrix.nix new file mode 100644 index 0000000..6a57e76 --- /dev/null +++ b/config/matrix.nix @@ -0,0 +1,37 @@ +{ config, lib, pkgs, ... }: +let + matrixPort = (import ../data/aliases.nix).services.matrix.port; + matrixFederationPort = (import ../data/aliases.nix).services.matrixFederation.port; +in +{ + networking.firewall.allowedTCPPorts = [ matrixPort matrixFederationPort ]; + + services.matrix-synapse = { + enable = true; + server_name = "orbekk.com"; + # registration_shared_secret = "disable_after_registration"; + listeners = [ + { + port = matrixPort; + bind_address = ""; + type = "http"; + tls = false; + x_forwarded = true; + resources = [ + { names = ["client" "webclient"]; compress = true; } + # { names = ["federation"]; compress = false; } + ]; + } + { + port = matrixFederationPort; + bind_address = ""; + type = "http"; + tls = true; + x_forwarded = false; + resources = [ + { names = ["federation"]; compress = false; } + ]; + } + ]; + }; +} diff --git a/data/aliases.nix b/data/aliases.nix index 73a86a6..13a93d5 100644 --- a/data/aliases.nix +++ b/data/aliases.nix @@ -4,5 +4,7 @@ rec { }; services = { hydra = { address = ip.shape; port = 11101; }; + matrix = { address = ip.shape; port = 11102; }; + matrixFederation = { address = ip.shape; port = 8448; }; }; } diff --git a/machines/container-shape.nix b/machines/container-shape.nix index d68639d..e885a0e 100644 --- a/machines/container-shape.nix +++ b/machines/container-shape.nix @@ -6,6 +6,7 @@ ../config/users.nix # Services ../config/hydra.nix + ../config/matrix.nix ]; networking = { |