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

@@ -84,6 +84,8 @@ in
description = "A yaml python logging config file";
};
enableSlidingSync = mkEnableOption (lib.mdDoc "automatic Sliding Sync setup at `slidingsync.<domain>`");
settings = mkOption {
type = types.submodule {
freeformType = format.type;
@@ -394,5 +396,19 @@ in
};
};
};
services.matrix-synapse-next.settings.extra_well_known_client_content."org.matrix.msc3575.proxy" = mkIf cfg.enableSlidingSync {
url = "https://${config.services.matrix-synapse.sliding-sync.publicBaseUrl}";
};
services.matrix-synapse.sliding-sync = mkIf cfg.enableSlidingSync {
enable = true;
enableNginx = lib.mkDefault cfg.enableNginx;
publicBaseUrl = lib.mkDefault "slidingsync.${cfg.settings.server_name}";
settings = {
SYNCV3_SERVER = lib.mkDefault "https://${cfg.public_baseurl}";
SYNCV3_PROM = lib.mkIf cfg.settings.enable_metrics (lib.mkDefault "127.0.0.1:9001");
};
};
};
}

View File

@@ -230,6 +230,9 @@ in
locations."/_synapse/client" = {
proxyPass = "http://$synapse_backend";
};
locations."/.well-known/matrix" = {
proxyPass = "http://$synapse_backend";
};
};
};
}