1
1
mirror of https://github.com/dali99/nixos-matrix-modules.git synced 2025-09-10 04:53:48 +02:00

Implement easy sliding sync setup

Co-authored-by: h7x4 <h7x4@nani.wtf>
This commit is contained in:
2023-09-21 19:29:04 +02:00
parent bedede1e6d
commit 50ae1b6e57
4 changed files with 50 additions and 0 deletions

View File

@@ -15,6 +15,13 @@ in
description = "What package to use for the sliding-sync proxy.";
};
enableNginx = lib.mkEnableOption (lib.mdDoc "autogenerated nginx config");
publicBaseUrl = lib.mkOption {
type = lib.types.str;
description = "The domain where clients connect, only has an effect with enableNginx";
example = "slidingsync.matrix.org";
};
settings = lib.mkOption {
type = lib.types.submodule {
freeformType = with lib.types; attrsOf str;
@@ -98,5 +105,13 @@ in
WorkingDirectory = "%S/matrix-sliding-sync";
};
};
services.nginx.virtualHosts.${cfg.publicBaseUrl} = lib.mkIf cfg.enableNginx {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = lib.replaceStrings [ "0.0.0.0" "::" ] [ "127.0.0.1" "::1" ] "http://${cfg.settings.SYNCV3_BINDADDR}";
};
};
};
}