From 5586103fc3b5823ad9ac23a2ea590a7ad38d2805 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Fri, 4 Nov 2022 21:33:22 +0100 Subject: [PATCH] Cleanup --- machines/lasting-integrity/default.nix | 52 ++++++++++++-------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/machines/lasting-integrity/default.nix b/machines/lasting-integrity/default.nix index 840f0b98..7a93d30c 100644 --- a/machines/lasting-integrity/default.nix +++ b/machines/lasting-integrity/default.nix @@ -74,35 +74,31 @@ { fqdn = "vanpetegem.me"; options = { - locations = - let - matrixRedirect = { - proxyPass = "http://127.0.0.1:8448"; - extraConfig = '' - proxy_read_timeout 600; - client_max_body_size 10M; - proxy_set_header X-Forwarded-Ssl on; - ''; - }; - in - { - "/_matrix" = matrixRedirect; - "/.well-known/matrix" = { - root = pkgs.runCommand "well-known-matrix" { } '' - mkdir -p $out/.well-known/matrix - echo '{"m.server":"matrix.vanpetegem.me:443"}' > $out/.well-known/matrix/server - echo '{"m.homeserver":{"base_url":"https://matrix.vanpetegem.me"}}' > $out/.well-known/matrix/client - ''; - extraConfig = '' - default_type application/json; - add_header 'access-control-allow-origin' '*' always; - add_header 'access-control-allow-methods' 'GET, HEAD, POST, PUT, DELETE, OPTIONS' always; - add_header 'access-control-allow-headers' 'X-Requested-With, Content-Type, Authorization, Date' always; - ''; - priority = 1; - }; - "/".return = "307 https://www.vanpetegem.me$request_uri"; + locations = { + "/_matrix" = { + proxyPass = "http://127.0.0.1:8448"; + extraConfig = '' + proxy_read_timeout 600; + client_max_body_size 10M; + proxy_set_header X-Forwarded-Ssl on; + ''; }; + "/.well-known/matrix" = { + root = pkgs.runCommand "well-known-matrix" { } '' + mkdir -p $out/.well-known/matrix + echo '{"m.server":"matrix.vanpetegem.me:443"}' > $out/.well-known/matrix/server + echo '{"m.homeserver":{"base_url":"https://matrix.vanpetegem.me"}}' > $out/.well-known/matrix/client + ''; + extraConfig = '' + default_type application/json; + add_header 'access-control-allow-origin' '*' always; + add_header 'access-control-allow-methods' 'GET, HEAD, POST, PUT, DELETE, OPTIONS' always; + add_header 'access-control-allow-headers' 'X-Requested-With, Content-Type, Authorization, Date' always; + ''; + priority = 1; + }; + "/".return = "307 https://www.vanpetegem.me$request_uri"; + }; }; } { fqdn = "www.vanpetegem.me"; }