From d1a3353419b8b01d7ff80fe8a80f535fffff1641 Mon Sep 17 00:00:00 2001 From: eyjhb Date: Thu, 29 Aug 2024 19:22:12 +0200 Subject: [PATCH] gerd.element: inital add of element chat --- machines/gerd.nix | 1 + machines/gerd/services/element.nix | 34 +++++++++-------------- machines/gerd/services/matrix-synapse.nix | 2 ++ 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/machines/gerd.nix b/machines/gerd.nix index 59c791c..cbc4941 100644 --- a/machines/gerd.nix +++ b/machines/gerd.nix @@ -20,6 +20,7 @@ ./gerd/services/nextcloud.nix ./gerd/services/stalwart + ./gerd/services/element.nix ./gerd/services/matrix-synapse.nix ]; diff --git a/machines/gerd/services/element.nix b/machines/gerd/services/element.nix index 2ed102a..2ad420c 100644 --- a/machines/gerd/services/element.nix +++ b/machines/gerd/services/element.nix @@ -1,36 +1,28 @@ { config, pkgs, ... }: let - svc_domain = ".${config.mine.shared.settings.domain}"; - pkg_element = pkgs.element-web.override { - conf = { - brand = "Fricloud chat"; - default_server_config = { - "m.homeserver" = { - "base_url" = "https://fricloud.dk"; - server_name = "fricloud.dk"; - }; - "m.identity_server" = { - "base_url" = "https://vector.im"; - }; - }; - }; - }; + svc_domain = "chat.${config.mine.shared.settings.domain}"; + # configure element web client + pkg_element = pkgs.element-web.override { + conf = { + default_theme = "dark"; + features.feature_latex_maths = true; + disable_guests = true; + + default_server_name = config.mine.shared.settings.domain; + }; + }; in { services.nginx.virtualHosts."${svc_domain}" = { forceSSL = true; enableACME = true; - locations."/". = { - alias = "${pkg_element}/"; - index = "index.html"; - }; + locations."/".root = pkg_element; }; - mine.shared.meta.element = { name = "Element"; - description = "We host our own Element instance."; + description = "We host our own Element instance, get on it and start chatting!"; url = "https://${svc_domain}"; package = let diff --git a/machines/gerd/services/matrix-synapse.nix b/machines/gerd/services/matrix-synapse.nix index 2cbe497..63a002f 100644 --- a/machines/gerd/services/matrix-synapse.nix +++ b/machines/gerd/services/matrix-synapse.nix @@ -182,6 +182,8 @@ in { matrix-synapse-config-authelia-secret.owner = matrix_synapse_user; }; + mine.shared.settings.matrix-synapse.domain = svc_domain; + mine.shared.meta.matrix-synapse = { name = "Matrix Synapse"; description = "We host our own Matrix homeserver using Synapse! Login using your favourite which supports OpenID.";