{ config, lib, ... }:
{
  imports = [ ./nginx ];

  config = lib.mkIf config.services.owncast.enable {
    services.owncast = {
      port = 8060;
      rtmp-port = 1945;
    };
    networking.firewall.extraInputRules = "ip saddr 11.0.0.0/8 tcp dport 1945 accept";
    environment.persistence."/persist".directories = [ "/var/lib/owncast" ];
  };
}
