From d23b59a8cb9b6da6cd92d33b36e7de2831579506 Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Mon, 16 Mar 2026 17:54:15 -0400 Subject: [PATCH] add rtc foci --- clients/quadraticserver/matrix/call.nix | 87 +++++++++++++----------- clients/quadraticserver/matrix/cinny.nix | 4 +- modules/server/continuwuity.nix | 4 +- 3 files changed, 51 insertions(+), 44 deletions(-) diff --git a/clients/quadraticserver/matrix/call.nix b/clients/quadraticserver/matrix/call.nix index 8dde73c..f682ccc 100644 --- a/clients/quadraticserver/matrix/call.nix +++ b/clients/quadraticserver/matrix/call.nix @@ -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 + } + ''; + }; + }; } diff --git a/clients/quadraticserver/matrix/cinny.nix b/clients/quadraticserver/matrix/cinny.nix index cff730a..1efe0f0 100644 --- a/clients/quadraticserver/matrix/cinny.nix +++ b/clients/quadraticserver/matrix/cinny.nix @@ -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; diff --git a/modules/server/continuwuity.nix b/modules/server/continuwuity.nix index 68aa3aa..63f8f9e 100644 --- a/modules/server/continuwuity.nix +++ b/modules/server/continuwuity.nix @@ -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}";