mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-08-10 13:54:38 -05:00
feat: refactored abstractions
This commit is contained in:
parent
f3897c1e0c
commit
2e0ba5f89e
23 changed files with 324 additions and 310 deletions
|
@ -1,25 +1,23 @@
|
|||
{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}";
|
||||
inherit (flake.config.service.instance) owncast web;
|
||||
service = owncast;
|
||||
localhost = web.localhost.address1;
|
||||
host = "${service.subdomain}.${web.domains.url1}";
|
||||
in {
|
||||
services = {
|
||||
owncast = {
|
||||
enable = true;
|
||||
listen = localhost;
|
||||
port = ports.port0;
|
||||
port = service.ports.port0;
|
||||
openFirewall = true;
|
||||
};
|
||||
caddy = {
|
||||
virtualHosts = {
|
||||
"${host}" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy ${localhost}:${toString ports.port0}
|
||||
reverse_proxy ${localhost}:${toString service.ports.port0}
|
||||
|
||||
tls ${ssl.cert} ${ssl.key}
|
||||
tls ${service.ssl.cert} ${service.ssl.key}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
@ -29,8 +27,8 @@ in {
|
|||
networking = {
|
||||
firewall = {
|
||||
allowedTCPPorts = [
|
||||
ports.port0
|
||||
ports.port1
|
||||
service.ports.port0
|
||||
service.ports.port1
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue