This commit is contained in:
Henry Hiles 2025-10-17 13:56:14 -04:00
commit 49237cd86d
No known key found for this signature in database
15 changed files with 152 additions and 55 deletions

View file

@ -0,0 +1,47 @@
{ config, lib, ... }:
{
options.quad.matrix = {
enable = lib.mkEnableOption "matrix";
domain = lib.mkOption { type = lib.types.string; };
settings = lib.mkOption {
type = lib.types.submodule { };
default = { };
};
};
config = {
systemd.services.continuwuity.serviceConfig.Restart = lib.mkForce "always";
services =
let
subdomain = "matrix.${config.quad.matrix.domain}";
socket = "/var/run/continuwuity/continuwuity.sock";
in
{
matrix-continuwuity = {
enable = config.quad.matrix.enable;
group = "caddy";
settings.global = config.quad.matrix.settings // {
server_name = config.quad.matrix.domain;
unix_socket_path = socket;
new_user_displayname_suffix = "";
allow_public_room_directory_over_federation = true;
trusted_servers = [
"matrix.org"
"tchncs.de"
"maunium.net"
];
ignore_messages_from_server_names = [ ];
url_preview_domain_explicit_allowlist = [ "*" ];
well_known = {
client = "https://${subdomain}";
server = "${subdomain}:443";
};
};
};
caddy.virtualHosts."${subdomain}".extraConfig = "reverse_proxy unix/${socket}";
};
};
}