diff --git a/modules/services/matrix.nix b/modules/services/matrix.nix index 256ddfe..98ecaf1 100644 --- a/modules/services/matrix.nix +++ b/modules/services/matrix.nix @@ -2,6 +2,7 @@ flake.nixosModules.matrix = { config, lib, + pkgs, ... }: let cfg = config.hive.matrix; @@ -25,6 +26,12 @@ description = "The internal port of the ketesa virtual host"; }; + elementWebLocalPort = lib.mkOption { + type = lib.types.int; + default = 8476; + description = "The internal port of the element-web virtual host"; + }; + hiddenServiceHostnameSopsKey = lib.mkOption { type = lib.types.str; description = "The sops key of the secret containing the hostname of the hidden service"; @@ -58,12 +65,19 @@ }; } { - port = 8080; + port = 8081; target = { addr = "127.0.0.1"; port = cfg.ketesaLocalPort; }; } + { + port = 8080; + target = { + addr = "127.0.0.1"; + port = cfg.elementWebLocalPort; + }; + } ]; }; }; @@ -81,6 +95,21 @@ root = "${ketesa-web-root}"; }; + # Virtual host for element web + services.nginx.virtualHosts."element-web-localhost" = { + listen = [ + { + addr = "127.0.0.1"; + port = cfg.elementWebLocalPort; + } + ]; + forceSSL = false; + enableACME = false; + root = pkgs.element-web.override { + conf.default_theme = "dark"; + }; + }; + # Secret hostname for matrix-synapse sops.templates."hidden-matrix-synapse".owner = "matrix-synapse"; sops.templates."hidden-matrix-synapse".content = ''