nix machine / user configurations

stuff

+40
+40
hosts/wolumonde/modules/conduit.nix
··· 1 + {config, pkgs, ...}: 2 + let 3 + wellKnownFileClient = 4 + pkgs.writeText "client" ( 5 + builtins.toJSON 6 + { "m.homeserver"."base_url" = "https://matrix.gaze.systems"; } 7 + ); 8 + wellKnownFileServer = 9 + pkgs.writeText "server" 10 + (builtins.toJSON { "m.server" = "matrix.gaze.systems:443"; }); 11 + in 12 + { 13 + services.matrix-conduit = { 14 + enable = true; 15 + settings.global = { 16 + server_name = "gaze.systems"; 17 + max_request_size = 1000 * 1000 * 20; 18 + allow_registration = true; 19 + allow_federation = true; 20 + trusted_servers = ["matrix.org" "nixos.dev" "conduit.rs"]; 21 + address = "::1"; 22 + port = 6167; 23 + }; 24 + }; 25 + 26 + services.nginx.virtualHosts."matrix.gaze.systems" = { 27 + enableACME = true; 28 + forceSSL = true; 29 + locations."/".proxyPass = 30 + "http://localhost:${toString config.services.matrix-conduit.settings.global.port}"; 31 + }; 32 + services.nginx.virtualHosts."gaze.systems" = { 33 + locations."/.well-known/matrix/client".extraConfig = '' 34 + alias ${wellKnownFileClient} 35 + ''; 36 + locations."/.well-known/matrix/server".extraConfig = '' 37 + alias ${wellKnownFileServer} 38 + ''; 39 + }; 40 + }