about summary refs log tree commit diff
path: root/modules/services/element-web.nix
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2024-01-24 19:18:11 +0900
committersefidel <contact@sefidel.net>2024-01-24 19:18:11 +0900
commit497c3cd7864fdbcc546408d6d86ebfad37aa9b78 (patch)
tree6cd5bf30b9953156d71192fa96e34a863dda5926 /modules/services/element-web.nix
parenta1dc1ff8c07155f697a30145168820612b28b6cd (diff)
downloadinfra-497c3cd7864fdbcc546408d6d86ebfad37aa9b78.tar.gz
infra-497c3cd7864fdbcc546408d6d86ebfad37aa9b78.zip
wip: try to use infra-modules infra-modules
Diffstat (limited to 'modules/services/element-web.nix')
-rw-r--r--modules/services/element-web.nix47
1 files changed, 0 insertions, 47 deletions
diff --git a/modules/services/element-web.nix b/modules/services/element-web.nix
deleted file mode 100644
index 2b200bd..0000000
--- a/modules/services/element-web.nix
+++ /dev/null
@@ -1,47 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with lib;
-let
-  cfg = config.modules.services.element-web;
-in
-{
-  options.modules.services.element-web = {
-    enable = mkEnableOption "element-web";
-    package = mkOption { type = types.package; default = pkgs.element-web; };
-    hostName = mkOption { type = types.str; default = config.networking.hostName; };
-    matrix = {
-      baseUrl = mkOption { type = types.str; default = "https://matrix.${config.networking.hostName}"; };
-      serverName = mkOption { type = types.str; default = config.networking.hostName; };
-    };
-    tls.acmeHost = mkOption { type = types.str; default = cfg.hostName; };
-    jitsi.domain = mkOption { type = types.str; default = "jitsi.${cfg.hostName}"; };
-  };
-
-  config = mkIf cfg.enable {
-    services.nginx.virtualHosts.${cfg.hostName} = {
-      useACMEHost = cfg.tls.acmeHost;
-      forceSSL = true;
-
-      root = cfg.package.override {
-        conf = {
-          default_server_config = {
-            "m.homeserver" = {
-              "base_url" = cfg.matrix.baseUrl;
-              "server_name" = cfg.matrix.serverName;
-            };
-            "m.identity_server" = {
-              "base_url" = "https://vector.im";
-            };
-          };
-          showLabsSettings = true;
-        } // optionalAttrs (cfg.jitsi.domain != null) {
-          jitsi.preferredDomain = cfg.jitsi.domain;
-        };
-      };
-
-      locations."~ \\.(js|css|woff|woff2?|png|jpe?g|svg)$".extraConfig = ''
-        add_header Cache-Control "public, max-age=14400, must-revalidate";
-      '';
-    };
-  };
-}