Skip to content

Commit

Permalink
sliding-sync: deprecate
Browse files Browse the repository at this point in the history
  • Loading branch information
dali99 committed Sep 27, 2024
1 parent f4e20d0 commit f884383
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
9 changes: 9 additions & 0 deletions sliding-sync/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ in
};

config = lib.mkIf cfg.enable {
warnings = lib.optionals config.services.matrix-synapse-next.enable [
''
services.matrix-synapse.sliding-sync is no longer necessary to use sliding-sync with synapse,
and the extra module will be removed from `nixos-matrix-modules` in the future.
If you are only using this service via `nixos-matrix-modules` you can safely remove options like
`services.matrix-synapse.sliding-sync.environmentFile`.
''
];

services.postgresql = lib.optionalAttrs cfg.createDatabase {
enable = true;
ensureDatabases = [ "matrix-sliding-sync" ];
Expand Down
17 changes: 3 additions & 14 deletions synapse-module/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ in
message = "Some listeners are missing either a socket path or a bind_address + port to listen on";
}) cfg.settings.listeners);

warnings = [ ] ++ lib.optional cfg.enableSlidingSync
"the option services.matrix-synapse-next.enableSlidingSync no longer has any effect (and is enabled by default)";

users.users.matrix-synapse = {
group = "matrix-synapse";
home = cfg.dataDir;
Expand Down Expand Up @@ -452,19 +455,5 @@ 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");
};
};
};
}

0 comments on commit f884383

Please sign in to comment.