feat(matrix): Switch to conduwuit

This fixes support for the new sliding sync API.
This commit is contained in:
Tristan Daniël Maat 2025-04-04 21:06:27 +08:00
parent a398790ef4
commit 3c6afa0c66
Signed by: tlater
GPG key ID: 49670FD774E43268
4 changed files with 807 additions and 139 deletions
configuration
hardware-specific/hetzner
services/conduit
flake.lockflake.nix

View file

@ -80,6 +80,17 @@
inherit mountOptions;
mountpoint = "/var";
};
"/volume/var/lib/private/matrix-conduit" = {
mountOptions = [
# Explicitly don't compress here, since
# conduwuit's database does compression by
# itself, and relies on being able to read the
# raw file data from disk (which is impossible
# if btrfs compresses it)
"noatime"
];
mountpoint = "/var/lib/private/matrix-conduit";
};
"/volume/nix-store" = {
inherit mountOptions;
mountpoint = "/nix";

View file

@ -1,4 +1,6 @@
{
pkgs,
flake-inputs,
config,
lib,
...
@ -18,10 +20,12 @@ in
services.matrix-conduit = {
enable = true;
package = flake-inputs.conduwuit.packages.${pkgs.system}.default;
settings.global = {
address = "127.0.0.1";
server_name = domain;
database_backend = "rocksdb";
new_user_displayname_suffix = "🦆";
allow_check_for_updates = true;
# Set up delegation: https://docs.conduit.rs/delegation.html#automatic-recommended
# This is primarily to make sliding sync work
@ -44,11 +48,14 @@ in
};
};
# Pass in the TURN secret via EnvironmentFile, not supported by
# upstream module currently.
#
# See also https://gitlab.com/famedly/conduit/-/issues/314
systemd.services.conduit.serviceConfig.EnvironmentFile = config.sops.secrets."turn/env".path;
systemd.services.conduit.serviceConfig = {
ExecStart = lib.mkForce "${config.services.matrix-conduit.package}/bin/conduwuit";
# Pass in the TURN secret via EnvironmentFile, not supported by
# upstream module currently.
#
# See also https://gitlab.com/famedly/conduit/-/issues/314
EnvironmentFile = config.sops.secrets."turn/env".path;
};
systemd.services.coturn.serviceConfig.SupplementaryGroups = [
config.security.acme.certs."tlater.net".group

File diff suppressed because it is too large Load diff

View file

@ -4,6 +4,10 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11-small";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable-small";
conduwuit = {
url = "github:girlbossceo/conduwuit";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";