about summary refs log tree commit diff
path: root/modules/services/jitsi.nix
blob: ab02bb487d702f37c05ee66f49c5c1e72af8acd0 (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
{ 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 ];
  };
}