2022-12-11 13:28:31 +01:00
|
|
|
{ lib, pkgs, config, baseDomain, ...}:
|
|
|
|
let
|
|
|
|
matrixWellKnown = {
|
|
|
|
client."m.homeserver".base_url = "https://matrix.${baseDomain}/";
|
|
|
|
server."m.server" = "matrix.${baseDomain}:443";
|
|
|
|
};
|
|
|
|
toJSONFile = name: value: pkgs.writeText name (builtins.toJSON value);
|
|
|
|
matrixWellKnownDir = pkgs.linkFarm "matrix-well-known" (builtins.mapAttrs toJSONFile matrixWellKnown);
|
|
|
|
in {
|
2022-12-11 12:19:04 +01:00
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
enableReload = true;
|
|
|
|
recommendedGzipSettings = true;
|
|
|
|
recommendedOptimisation = true;
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
recommendedTlsSettings = true;
|
|
|
|
|
|
|
|
virtualHosts.${baseDomain} = {
|
|
|
|
default = true;
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
2022-12-11 13:28:31 +01:00
|
|
|
serverAliases = [ "www.${baseDomain}" ];
|
2022-12-11 12:19:04 +01:00
|
|
|
# TODO: Change this to be deployed by some sort of CI + rsync so we don't need to always update the package version
|
|
|
|
locations."/".root = pkgs.chaos-jetzt-website-pelican;
|
2022-12-11 13:28:31 +01:00
|
|
|
locations."/.well-known/matrix/".alias = matrixWellKnownDir + "/";
|
2022-12-11 12:19:04 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|