add rtc foci
This commit is contained in:
parent
c92082e6bf
commit
d23b59a8cb
3 changed files with 48 additions and 41 deletions
|
|
@ -4,53 +4,60 @@
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
domain = "call.federated.nexus";
|
||||||
|
livekitDomain = "livekit.call.federated.nexus";
|
||||||
|
lkJwtServiceDomain = "lk-jwt.call.federated.nexus";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
systemd.services = {
|
systemd.services = {
|
||||||
livekit.serviceConfig.Restart = lib.mkForce "always";
|
livekit.serviceConfig.Restart = lib.mkForce "always";
|
||||||
lk-jwt-service.serviceConfig.Restart = lib.mkForce "always";
|
lk-jwt-service.serviceConfig.Restart = lib.mkForce "always";
|
||||||
};
|
};
|
||||||
|
|
||||||
services =
|
quad.matrix.settings.matrix_rtc.foci = [
|
||||||
let
|
|
||||||
domain = "call.federated.nexus";
|
|
||||||
livekitDomain = "livekit.call.federated.nexus";
|
|
||||||
lkJwtServiceDomain = "lk-jwt.call.federated.nexus";
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
livekit = {
|
type = "livekit";
|
||||||
enable = true;
|
livekit_service_url = lkJwtServiceDomain;
|
||||||
openFirewall = true;
|
}
|
||||||
keyFile = config.age.secrets."livekitKeys.age".path;
|
];
|
||||||
settings.room.auto_create = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
lk-jwt-service = {
|
services = {
|
||||||
enable = true;
|
livekit = {
|
||||||
livekitUrl = "wss://${livekitDomain}";
|
enable = true;
|
||||||
keyFile = config.services.livekit.keyFile;
|
openFirewall = true;
|
||||||
};
|
keyFile = config.age.secrets."livekitKeys.age".path;
|
||||||
|
settings.room.auto_create = false;
|
||||||
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
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,8 @@
|
||||||
src = pkgs.fetchFromCodeberg {
|
src = pkgs.fetchFromCodeberg {
|
||||||
owner = "lapingvino";
|
owner = "lapingvino";
|
||||||
repo = "cinny";
|
repo = "cinny";
|
||||||
rev = "8228227f64cf22c8cda2bc7cea1d5948d007822b";
|
rev = "2ccfeeabfa0f1ac22ba216d3e8a993199e46e8f5";
|
||||||
hash = "sha256-JcZ2jhKrxwtzbnhvCAS4yVF788TmocYoIOFJsV0QdbU=";
|
hash = "sha256-AeJnT4itxpoIu2MqEapi7zv5TomDuUuj0wVs9oMTxCs=";
|
||||||
};
|
};
|
||||||
npmDeps = pkgs.fetchNpmDeps {
|
npmDeps = pkgs.fetchNpmDeps {
|
||||||
inherit src;
|
inherit src;
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
enable = config.quad.matrix.enable;
|
enable = config.quad.matrix.enable;
|
||||||
package = inputs.continuwuity.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
package = inputs.continuwuity.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||||
group = "caddy";
|
group = "caddy";
|
||||||
settings.global = config.quad.matrix.settings // {
|
settings.global = lib.recursiveUpdate {
|
||||||
server_name = config.quad.matrix.domain;
|
server_name = config.quad.matrix.domain;
|
||||||
unix_socket_path = socket;
|
unix_socket_path = socket;
|
||||||
|
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
client = "https://${subdomain}";
|
client = "https://${subdomain}";
|
||||||
server = "${subdomain}:443";
|
server = "${subdomain}:443";
|
||||||
};
|
};
|
||||||
};
|
} config.quad.matrix.settings;
|
||||||
};
|
};
|
||||||
|
|
||||||
caddy.virtualHosts."${subdomain}".extraConfig = "reverse_proxy unix/${socket}";
|
caddy.virtualHosts."${subdomain}".extraConfig = "reverse_proxy unix/${socket}";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue