about summary refs log tree commit diff
path: root/modules/services/jitsi.nix
blob: 1152ac011f4b4054af814325036cbc6d9aaef8de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ config, lib, ... }:

with lib;
let
  cfg = config.modules.services.jitsi;
in
{
  options.modules.services.jitsi = {
    enable = mkEnableOption "jitsi";
    hostName = mkOption { type = types.str; default = config.networking.hostName; };
    tls.acmeHost = mkOption { type = types.str; default = cfg.hostName; };
  };

  config = mkIf cfg.enable {
    services.jitsi-meet = {
      enable = true;
      hostName = cfg.hostName;

      config = {
        prejoinPageEnabled = true;
      };

      interfaceConfig = {
        SHOW_JITSI_WATERMARK = false;
      };
    };

    services.jitsi-videobridge.openFirewall = true;

    services.nginx.virtualHosts.${cfg.hostName} = {
      enableACME = mkForce false;
      useACMEHost = cfg.tls.acmeHost;
      forceSSL = true;
    };

    networking.firewall.allowedTCPPorts = [ 80 443 ];

    modules.persistence.directories = [
      "/var/lib/prosody"
      "/var/lib/jitsi-meet"
    ];
  };
}