owncast: init

This commit is contained in:
Katherina Walshe-Grey 2025-04-28 15:18:41 +01:00
parent c22c1e3768
commit 278e172881
3 changed files with 43 additions and 0 deletions

35
services/owncast.nix Normal file
View file

@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkOption mkEnableOption types;
cfg = config.qenya.services.owncast;
in
{
options.qenya.services.owncast = {
enable = mkEnableOption "Owncast";
domain = mkOption {
type = types.str;
};
dataDir = mkOption {
type = types.str;
};
};
config = mkIf cfg.enable {
services.nginx = {
enable = true;
virtualHosts = {
${cfg.domain} = {
forceSSL = true;
enableACME = true;
locations."/".proxyPass = "http://127.0.0.1:8080/";
};
};
};
networking.firewall.allowedTCPPorts = [ 80 443 1935 ]; # 1935 for rtmp
services.owncast.enable = true;
services.owncast.dataDir = cfg.dataDir;
};
}