aboutsummaryrefslogtreecommitdiff
path: root/hosts/sagittarius/web/matrix.nix
diff options
context:
space:
mode:
authorIsabella Bastaja <isabella@sorre.xyz>2026-05-23 18:25:27 +0200
committerIsabella Bastaja <isabella@sorre.xyz>2026-05-23 18:25:40 +0200
commit5e47a38f855c1468e88ec31954cc98cf4a5eff90 (patch)
treeef8f2edda1e6f49af3bb03c7524f24a371f3288f /hosts/sagittarius/web/matrix.nix
parent2b201fe8d392549d2d9e5926b4d0456c81714ab0 (diff)
sagittarius: remove observability and matrix modules
Diffstat (limited to 'hosts/sagittarius/web/matrix.nix')
-rw-r--r--hosts/sagittarius/web/matrix.nix117
1 files changed, 0 insertions, 117 deletions
diff --git a/hosts/sagittarius/web/matrix.nix b/hosts/sagittarius/web/matrix.nix
deleted file mode 100644
index c971ddc..0000000
--- a/hosts/sagittarius/web/matrix.nix
+++ /dev/null
@@ -1,117 +0,0 @@
-{ pkgs, config, ... }:
-let
- server_name = "sorre.xyz";
- matrix_hostname = "matrix.${server_name}";
- #admin_email = "gloss_unranked088@simplelogin.com";
-
- # Build a dervation that stores the content of `${server_name}/.well-known/matrix/server`
- well_known_server = pkgs.writeText "well-known-matrix-server" ''
- {
- "m.server": "${matrix_hostname}"
- }
- '';
-
- # Build a dervation that stores the content of `${server_name}/.well-known/matrix/client`
- well_known_client = pkgs.writeText "well-known-matrix-client" ''
- {
- "m.homeserver": {
- "base_url": "https://${matrix_hostname}"
- }
- }
- '';
-in
-{
- imports = [ ./acme.nix ];
-
- networking.firewall.allowedTCPPorts = [
- 80
- 443
- 8448
- ];
- networking.firewall.allowedUDPPorts = [
- 80
- 443
- 8448
- ];
-
- services.matrix-conduit = {
- enable = true;
- settings.global.server_name = server_name;
- settings.global.allow_registration = false;
- };
-
- services.nginx = {
- enable = true;
- recommendedProxySettings = true;
-
- virtualHosts."${matrix_hostname}" = {
- enableACME = true;
- forceSSL = true;
-
- listen = [
- {
- addr = "0.0.0.0";
- port = 443;
- ssl = true;
- }
- {
- addr = "[::]";
- port = 443;
- ssl = true;
- }
- {
- addr = "0.0.0.0";
- port = 8448;
- ssl = true;
- }
- {
- addr = "[::]";
- port = 8448;
- ssl = true;
- }
- ];
- locations."/_matrix/" = {
- proxyPass = "http://backend_conduit$request_uri";
- proxyWebsockets = true;
- extraConfig = ''
- proxy_set_header Host $host;
- proxy_buffering off;
- '';
- };
- extraConfig = ''
- merge_slashes off;
- '';
- };
-
- virtualHosts."${server_name}" = {
- enableACME = true;
- forceSSL = true;
-
- locations = {
- "=/.well-known/matrix/server" = {
- alias = "${well_known_server}";
- extraConfig = ''
- # Set the header since by default NGINX thinks it's just bytes
- default_type application/json;
- '';
- };
- "=/.well-known/matrix/client" = {
- # Use the contents of the derivation built previously
- alias = "${well_known_client}";
-
- extraConfig = ''
- # Set the header since by default NGINX thinks it's just bytes
- default_type application/json;
-
- # https://matrix.org/docs/spec/client_server/r0.4.0#web-browser-clients
- add_header Access-Control-Allow-Origin "*";
- '';
- };
- };
- };
-
- upstreams."backend_conduit".servers = {
- "[::1]:${toString config.services.matrix-conduit.settings.global.port}" = { };
- };
- };
-}