matrix: sliding sync

This commit is contained in:
Vivian 2024-07-13 23:59:59 +02:00
parent 8009002c89
commit 3a72f649d4
2 changed files with 36 additions and 9 deletions

View file

@ -2,13 +2,17 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
let
vs = config.vault-secrets.secrets;
port = 8008;
slidingSyncPort = 8009;
metricsPort = 9000;
in
{
{
imports = [ ];
# This value determines the NixOS release from which the default
@ -19,7 +23,7 @@ in
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.11"; # Did you read the comment?
networking.firewall.allowedTCPPorts = [ port metricsPort ];
networking.firewall.allowedTCPPorts = [ port metricsPort slidingSyncPort ];
vault-secrets.secrets.synapse = {
user = "matrix-synapse";
@ -38,6 +42,16 @@ in
'';
};
services.matrix-sliding-sync = {
enable = true;
createDatabase = true;
environmentFile = "${vs.synapse}/sync";
settings = {
SYNCV3_SERVER = "http://localhost:${toString port}";
SYNCV3_BINDADDR = ":${toString slidingSyncPort}";
};
};
services.matrix-synapse = {
enable = true;
withJemalloc = true;
@ -109,3 +123,5 @@ in
};
};
}