mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-17 10:35:13 -05:00
37 lines
809 B
Nix
Executable file
37 lines
809 B
Nix
Executable file
{flake, ...}: let
|
|
inherit (flake.config.people) user0;
|
|
inherit (flake.config.people.user.${user0}) domain;
|
|
inherit (flake.config.system.device) wildcard;
|
|
inherit (flake.config.service.instance.owncast) ports subdomain ssl;
|
|
localhost = wildcard.ip.address1;
|
|
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}
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
networking = {
|
|
firewall = {
|
|
allowedTCPPorts = [
|
|
ports.port0
|
|
ports.port1
|
|
];
|
|
};
|
|
};
|
|
}
|