Files
nixos/modules/services/owncast.nix
Joakim Repomaa 913d3d1238 refactor
2025-02-08 21:17:11 +02:00

27 lines
601 B
Nix

{ lib, config, ... }:
let
cfg = config.modules.services.owncast;
fqdn = "${cfg.subdomain}.${config.networking.domain}";
in
{
options.modules.services.owncast = {
enable = lib.mkEnableOption "Enable Owncast";
subdomain = lib.mkOption {
type = lib.types.str;
};
port = lib.mkOption {
type = lib.types.int;
default = 8080;
};
};
config = lib.mkIf cfg.enable {
services.owncast = {
enable = true;
openFirewall = true;
inherit (cfg) port;
};
modules.services.webserver.vHosts.${fqdn}.locations."/".proxyPort = cfg.port;
};
}