Add Matrix sliding-sync service

This commit is contained in:
Jakob Lechner 2024-09-11 18:21:25 +02:00
parent 0006377763
commit 2db35dfc54
6 changed files with 42 additions and 3 deletions

View file

@ -21,6 +21,16 @@ in
};
};
};
sliding-sync = {
port = mkOption {
description = "TCP port for synapse service.";
type = port;
};
secretFile = mkOption {
type = path;
description = "Location of the file to set secret environment variables.";
};
};
fqdn = mkOption {
type = str;
description = ''
@ -82,6 +92,7 @@ in
imports = [
./mautrix-signal.nix
./mautrix-whatsapp.nix
./sliding-sync.nix
./synapse.nix
];
}

View file

@ -0,0 +1,18 @@
{ config, lib, pkgs, ... }:
let
cfg = config.jalr.matrix;
in
lib.mkIf cfg.enable {
services.matrix-sliding-sync = {
enable = true;
settings = {
SYNCV3_SERVER = "https://${cfg.fqdn}";
SYNCV3_BINDADDR = "127.0.0.1:${toString cfg.sliding-sync.port}";
};
environmentFile = cfg.sliding-sync.secretFile;
};
services.nginx.virtualHosts."${cfg.fqdn}".locations."/_matrix/client/unstable/org.matrix.msc3575/sync" = {
proxyPass = "http://127.0.0.1:${toString cfg.sliding-sync.port}";
};
}