2024-10-18 22:05:40 -05:00
|
|
|
{flake, ...}: let
|
|
|
|
inherit (flake.config.people) user0;
|
2024-10-18 22:07:08 -05:00
|
|
|
inherit (flake.config.people.user.${user0}) domain;
|
2024-10-18 22:05:40 -05:00
|
|
|
inherit (flake.config.system.device) server wildcard;
|
|
|
|
inherit (flake.config.service.instance.owncast) paths ports subdomain ssl name;
|
|
|
|
localhost = wildcard.ip.address0;
|
|
|
|
host = "${subdomain}.${domain.url1}";
|
|
|
|
in {
|
|
|
|
services = {
|
|
|
|
owncast = {
|
|
|
|
enable = true;
|
|
|
|
listen = localhost;
|
|
|
|
port = ports.port0;
|
|
|
|
openFirewall = true;
|
|
|
|
};
|
|
|
|
caddy = {
|
|
|
|
virtualHosts = {
|
|
|
|
"${host}" = {
|
|
|
|
extraConfig = ''
|
|
|
|
reverse_proxy ${localhost}:${toString ports.port0}
|
|
|
|
|
|
|
|
tls ${ssl.cert} ${ssl.key}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-10-18 22:36:36 -05:00
|
|
|
# fileSystems."/var/lib/${name}" = {
|
|
|
|
# device = paths.path0;
|
|
|
|
# fsType = "none";
|
|
|
|
# options = ["bind"];
|
|
|
|
# depends = [server.storage0.mount];
|
|
|
|
# };
|
2024-10-18 22:05:40 -05:00
|
|
|
|
2024-10-18 22:36:36 -05:00
|
|
|
# systemd.tmpfiles.rules = [
|
|
|
|
# "Z ${paths.path0} 755 ${name} ${name} -"
|
|
|
|
# ];
|
2024-10-18 22:05:40 -05:00
|
|
|
|
|
|
|
networking = {
|
|
|
|
firewall = {
|
|
|
|
allowedTCPPorts = [
|
|
|
|
ports.port0
|
|
|
|
ports.port1
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|