30 lines
927 B
Nix
30 lines
927 B
Nix
{ config, pkgs, ... }:
|
|
|
|
let
|
|
net = import ../config/network.nix;
|
|
serv = import ../config/services.nix;
|
|
serviceValidation = import ../validation/service/continuwuity.nix;
|
|
|
|
serverName =
|
|
if net ? devices && builtins.isAttrs net.devices && net.devices ? remote_proxy && net.devices.remote_proxy ? domain && builtins.isString net.devices.remote_proxy.domain then
|
|
net.devices.remote_proxy.domain
|
|
else
|
|
throw "config/network.nix must define devices.remote_proxy.domain as string for continuwuity.";
|
|
|
|
trustedServers = serviceValidation.getTrustedServers serv;
|
|
in
|
|
{
|
|
services.matrix-continuwuity = {
|
|
enable = true;
|
|
settings = {
|
|
global = {
|
|
server_name = serverName;
|
|
allow_registration = true;
|
|
allow_encryption = true;
|
|
allow_federation = true;
|
|
max_request_size = 20 * 1024 * 1024; # 20 MiB
|
|
trusted_servers = trustedServers;
|
|
};
|
|
};
|
|
};
|
|
}
|