flake/systems/etna/matrix.nix
uku 26480457ff
chore(etna): refactor and split into different files
this also disables the matrix server (conduit) and removes an unused open firewall port
2024-04-02 20:53:12 +02:00

42 lines
1 KiB
Nix

{pkgs, ...}: {
cfTunnels."m.uku.moe" = "http://localhost:80";
services = {
matrix-conduit = {
enable = true;
settings.global = {
server_name = "m.uku.moe";
allow_registration = true;
port = 6167;
};
};
nginx = {
enable = true;
recommendedProxySettings = true;
virtualHosts."m.uku.moe" = {
locations."=/.well-known/matrix/server" = let
filename = "server-well-known";
content = builtins.toJSON {"m.server" = "m.uku.moe:443";};
in {
alias = builtins.toString (pkgs.writeTextDir filename content) + "/";
tryFiles = "${filename} =200";
extraConfig = ''
default_type application/json;
'';
};
locations."/" = {
proxyPass = "http://localhost:6167/";
proxyWebsockets = true;
extraConfig = ''
proxy_set_header Host $host;
proxy_buffering off;
client_max_body_size 100M;
'';
};
};
};
};
}