add rtc foci

This commit is contained in:
Henry Hiles 2026-03-16 17:54:15 -04:00
commit d23b59a8cb
No known key found for this signature in database
3 changed files with 48 additions and 41 deletions

View file

@ -4,53 +4,60 @@
config,
...
}:
let
domain = "call.federated.nexus";
livekitDomain = "livekit.call.federated.nexus";
lkJwtServiceDomain = "lk-jwt.call.federated.nexus";
in
{
systemd.services = {
livekit.serviceConfig.Restart = lib.mkForce "always";
lk-jwt-service.serviceConfig.Restart = lib.mkForce "always";
};
services =
let
domain = "call.federated.nexus";
livekitDomain = "livekit.call.federated.nexus";
lkJwtServiceDomain = "lk-jwt.call.federated.nexus";
in
quad.matrix.settings.matrix_rtc.foci = [
{
livekit = {
enable = true;
openFirewall = true;
keyFile = config.age.secrets."livekitKeys.age".path;
settings.room.auto_create = false;
};
type = "livekit";
livekit_service_url = lkJwtServiceDomain;
}
];
lk-jwt-service = {
enable = true;
livekitUrl = "wss://${livekitDomain}";
keyFile = config.services.livekit.keyFile;
};
caddy.virtualHosts = {
"${livekitDomain}".extraConfig = "reverse_proxy 127.0.0.1:7880";
"${lkJwtServiceDomain}".extraConfig = "reverse_proxy 127.0.0.1:8080";
"${domain}".extraConfig = ''
root * ${pkgs.element-call}
route {
respond /config.json `${
builtins.toJSON {
default_server_config = {
"m.homeserver" = {
"base_url" = config.services.matrix-continuwuity.settings.global.well_known.client;
"server_name" = config.quad.matrix.domain;
};
};
}
}` 200
try_files {path} {path}/ /index.html
file_server
}
'';
};
services = {
livekit = {
enable = true;
openFirewall = true;
keyFile = config.age.secrets."livekitKeys.age".path;
settings.room.auto_create = false;
};
lk-jwt-service = {
enable = true;
livekitUrl = "wss://${livekitDomain}";
keyFile = config.services.livekit.keyFile;
};
caddy.virtualHosts = {
"${livekitDomain}".extraConfig = "reverse_proxy 127.0.0.1:7880";
"${lkJwtServiceDomain}".extraConfig = "reverse_proxy 127.0.0.1:8080";
"${domain}".extraConfig = ''
root * ${pkgs.element-call}
route {
respond /config.json `${
builtins.toJSON {
default_server_config = {
"m.homeserver" = {
"base_url" = config.services.matrix-continuwuity.settings.global.well_known.client;
"server_name" = config.quad.matrix.domain;
};
};
}
}` 200
try_files {path} {path}/ /index.html
file_server
}
'';
};
};
}

View file

@ -38,8 +38,8 @@
src = pkgs.fetchFromCodeberg {
owner = "lapingvino";
repo = "cinny";
rev = "8228227f64cf22c8cda2bc7cea1d5948d007822b";
hash = "sha256-JcZ2jhKrxwtzbnhvCAS4yVF788TmocYoIOFJsV0QdbU=";
rev = "2ccfeeabfa0f1ac22ba216d3e8a993199e46e8f5";
hash = "sha256-AeJnT4itxpoIu2MqEapi7zv5TomDuUuj0wVs9oMTxCs=";
};
npmDeps = pkgs.fetchNpmDeps {
inherit src;

View file

@ -34,7 +34,7 @@
enable = config.quad.matrix.enable;
package = inputs.continuwuity.packages.${pkgs.stdenv.hostPlatform.system}.default;
group = "caddy";
settings.global = config.quad.matrix.settings // {
settings.global = lib.recursiveUpdate {
server_name = config.quad.matrix.domain;
unix_socket_path = socket;
@ -68,7 +68,7 @@
client = "https://${subdomain}";
server = "${subdomain}:443";
};
};
} config.quad.matrix.settings;
};
caddy.virtualHosts."${subdomain}".extraConfig = "reverse_proxy unix/${socket}";