From c7970c619881935aa6618911cb4eedfa67de6a01 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Tue, 12 Apr 2022 15:45:08 +0000 Subject: [PATCH] Add Element web to Matrix deploy --- hosts/linode/synapse.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/hosts/linode/synapse.nix b/hosts/linode/synapse.nix index e102a8b..a045d06 100644 --- a/hosts/linode/synapse.nix +++ b/hosts/linode/synapse.nix @@ -2,7 +2,7 @@ # them by the following commands: # nix run nixpkgs.matrix-synapse # register_new_matrix_user -k "B9EoPr2WV9hzwc7uL2Sx1JmvCeKDEOGCpB0uginQcQtEH4wzRtkSIdo7lltrjSQa" http://localhost:8448 -{ config, ... }: +{ config, pkgs, ... }: let domain = "${config.networking.domain}"; fqdn = "matrix.${domain}"; @@ -50,6 +50,21 @@ return 200 '${builtins.toJSON client}'; proxyPass = "http://127.0.0.1:8448"; # Lacking the trailing / is correct }; }; + + # Run Element web + "chat.${fqdn}" = { + enableACME = true; + forceSSL = true; + serverAliases = [ + "chat.${domain}" + ]; + root = pkgs.element-web.override { + conf.default_server_config."m.homeserver" = { + "base_url" = "https://${fqdn}"; + "server_name" = "${fqdn}"; + }; + }; + }; }; };