mirror of
https://github.com/dali99/nixos-matrix-modules.git
synced 2025-09-10 04:53:48 +02:00
@@ -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}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user