2023-06-01 05:47:05 -07:00
|
|
|
{config, pkgs, lib, ...}:
|
|
|
|
|
|
|
|
let
|
|
|
|
personalization = import ./personalization.nix;
|
2023-06-19 14:25:50 -07:00
|
|
|
|
2023-06-01 05:47:05 -07:00
|
|
|
in
|
|
|
|
{
|
2023-06-19 14:25:50 -07:00
|
|
|
|
2023-06-19 14:34:46 -07:00
|
|
|
systemd.services.coturn-helper = {
|
2023-06-19 14:25:50 -07:00
|
|
|
|
|
|
|
script = ''
|
|
|
|
|
|
|
|
systemctl restart coturn
|
|
|
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
unitConfig = {
|
|
|
|
Type = "simple";
|
2023-07-20 21:49:28 -07:00
|
|
|
After = "btcpayserver.service";
|
2023-06-19 14:25:50 -07:00
|
|
|
Requires = "network-online.target";
|
|
|
|
};
|
|
|
|
|
|
|
|
serviceConfig = {
|
2023-06-19 18:48:11 -07:00
|
|
|
RemainAfterExit = "yes";
|
|
|
|
Type = "oneshot";
|
2023-06-19 14:25:50 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
2023-06-01 05:47:05 -07:00
|
|
|
};
|
2023-06-19 14:25:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
services.coturn = {
|
|
|
|
|
|
|
|
enable = true;
|
|
|
|
use-auth-secret = true;
|
2024-11-04 00:57:54 -08:00
|
|
|
static-auth-secret = "${personalization.coturn_static_auth_secret}";
|
2023-06-19 14:25:50 -07:00
|
|
|
realm = personalization.matrix_url;
|
|
|
|
cert = "/var/lib/coturn/${personalization.matrix_url}.crt.pem";
|
|
|
|
pkey = "/var/lib/coturn/${personalization.matrix_url}.key.pem";
|
|
|
|
min-port = 49152;
|
|
|
|
max-port = 65535;
|
2024-11-04 00:58:53 -08:00
|
|
|
listening-port = 5349;
|
2023-06-19 14:25:50 -07:00
|
|
|
no-cli = true;
|
|
|
|
extraConfig = ''
|
|
|
|
verbose
|
|
|
|
external-ip=${personalization.external_ip_secret}
|
2024-11-04 00:57:54 -08:00
|
|
|
stale-nonce
|
|
|
|
fingerprint
|
2023-06-19 14:25:50 -07:00
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2023-06-01 05:47:05 -07:00
|
|
|
}
|