This commit is contained in:
2022-07-24 15:18:29 -04:00
parent 60f1235848
commit 11072c374b
4 changed files with 36 additions and 0 deletions

View File

@@ -14,5 +14,6 @@
./radio.nix
./samba.nix
./cloudflared.nix
./owncast.nix
];
}

31
common/server/owncast.nix Normal file
View File

@@ -0,0 +1,31 @@
{ lib, config, ... }:
with lib;
let
cfg = config.services.owncast;
in {
options.services.owncast = {
hostname = lib.mkOption {
type = types.str;
example = "example.com";
};
};
config = mkIf cfg.enable {
services.owncast.listen = "127.0.0.1";
services.owncast.port = 62419; # random port
networking.firewall.allowedTCPPorts = [ cfg.rtmp-port ];
services.nginx.enable = true;
services.nginx.virtualHosts.${cfg.hostname} = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://localhost:${toString cfg.port}";
proxyWebsockets = true;
};
};
};
}