2023-11-07 08:12:43 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
modulesPath,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit
|
|
|
|
(lib)
|
2023-10-23 15:43:13 +00:00
|
|
|
mkIf
|
|
|
|
mkEnableOption
|
|
|
|
mkOption
|
2023-11-07 08:12:43 +00:00
|
|
|
head
|
|
|
|
;
|
2023-10-23 15:43:13 +00:00
|
|
|
inherit (lib.types) str;
|
|
|
|
cfg = config.services.mathebau-jitsi;
|
2023-11-07 08:12:43 +00:00
|
|
|
in {
|
2023-10-23 15:43:13 +00:00
|
|
|
imports = [(modulesPath + "/services/web-apps/jitsi-meet.nix")];
|
2023-11-07 08:12:43 +00:00
|
|
|
|
2023-10-23 15:43:13 +00:00
|
|
|
options.services.mathebau-jitsi = {
|
|
|
|
enable = mkEnableOption "mathebau jitsi service";
|
|
|
|
hostName = mkOption {
|
|
|
|
type = str;
|
|
|
|
};
|
|
|
|
localAddress = mkOption {
|
|
|
|
type = str;
|
|
|
|
default = (head config.networking.interfaces.enX0.ipv4.addresses).address;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.jitsi-meet = {
|
|
|
|
enable = true;
|
|
|
|
config = {
|
|
|
|
defaultLang = "de";
|
|
|
|
};
|
2023-11-07 08:12:43 +00:00
|
|
|
inherit (cfg) hostName;
|
2023-10-23 15:43:13 +00:00
|
|
|
};
|
|
|
|
services.jitsi-videobridge = {
|
|
|
|
openFirewall = true;
|
|
|
|
nat = {
|
|
|
|
publicAddress = "130.83.2.184";
|
2023-11-07 08:12:43 +00:00
|
|
|
inherit (cfg) localAddress;
|
2023-10-23 15:43:13 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
environment.persistence.${config.impermanence.name} = {
|
|
|
|
directories = [
|
|
|
|
"/var/lib/jitsi-meet"
|
|
|
|
"/var/lib/prosody"
|
|
|
|
];
|
|
|
|
};
|
2023-11-07 08:12:43 +00:00
|
|
|
#We are behind a reverse proxy that handles TLS
|
2023-10-23 15:43:13 +00:00
|
|
|
services.nginx.virtualHosts."${cfg.hostName}" = {
|
|
|
|
enableACME = false;
|
|
|
|
forceSSL = false;
|
|
|
|
};
|
|
|
|
|
2023-11-07 08:12:43 +00:00
|
|
|
#The network ports for HTTP(S) are not opened automatically
|
|
|
|
networking.firewall.allowedTCPPorts = [80 443];
|
2023-10-23 15:43:13 +00:00
|
|
|
};
|
|
|
|
}
|