dotfiles/nixos/modules/services/owncast.nix

43 lines
803 B
Nix
Raw Normal View History

2024-10-18 22:05:40 -05:00
{flake, ...}: let
2025-01-08 19:06:14 -06:00
inherit
(flake.config.services.instances)
owncast
web
;
2024-10-19 18:22:29 -05:00
service = owncast;
localhost = web.localhost.address1;
host = "${service.subdomain}.${web.domains.url1}";
2024-10-18 22:05:40 -05:00
in {
services = {
owncast = {
enable = true;
listen = localhost;
2024-10-19 18:22:29 -05:00
port = service.ports.port0;
2024-10-18 22:05:40 -05:00
openFirewall = true;
};
2024-11-06 02:45:19 -06:00
2024-10-18 22:05:40 -05:00
caddy = {
virtualHosts = {
"${host}" = {
extraConfig = ''
2024-10-19 18:22:29 -05:00
reverse_proxy ${localhost}:${toString service.ports.port0}
2024-10-18 22:05:40 -05:00
2024-10-19 18:22:29 -05:00
tls ${service.ssl.cert} ${service.ssl.key}
2024-10-18 22:05:40 -05:00
'';
};
};
};
};
networking = {
firewall = {
allowedTCPPorts = [
2024-10-19 18:22:29 -05:00
service.ports.port0
service.ports.port1
2024-10-18 22:05:40 -05:00
];
};
};
2024-11-06 02:45:19 -06:00
# OBS Server rtmp://192.168.50.140:1935/live
2024-10-18 22:05:40 -05:00
}