diff --git a/machines/gerd/services/element.nix b/machines/gerd/services/element.nix new file mode 100644 index 0000000..2ed102a --- /dev/null +++ b/machines/gerd/services/element.nix @@ -0,0 +1,44 @@ +{ 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"; + }; + }; + }; + }; + +in { + services.nginx.virtualHosts."${svc_domain}" = { + forceSSL = true; + enableACME = true; + locations."/". = { + alias = "${pkg_element}/"; + index = "index.html"; + }; + }; + + + mine.shared.meta.element = { + name = "Element"; + description = "We host our own Element instance."; + url = "https://${svc_domain}"; + + package = let + pkg = pkg_element; + in { + name = pkg.pname; + version = pkg.version; + meta = pkg.meta; + }; + }; +}