2024-12-19 22:37:17 -06:00
|
|
|
{flake, ...}: let
|
2024-12-20 00:34:07 -06:00
|
|
|
inherit (flake.config.machines.devices) server;
|
2024-12-08 22:53:40 -06:00
|
|
|
inherit (flake.config.services.instances) upRootNutrition web;
|
|
|
|
service = upRootNutrition;
|
|
|
|
localhost = web.localhost.address0;
|
|
|
|
host = web.domains.url3;
|
|
|
|
in {
|
|
|
|
services = {
|
|
|
|
caddy = {
|
|
|
|
virtualHosts = {
|
|
|
|
"${host}" = {
|
|
|
|
extraConfig = ''
|
2024-12-20 00:29:03 -06:00
|
|
|
root * /var/lib/website/dist/index.html
|
|
|
|
|
2024-12-19 22:37:17 -06:00
|
|
|
redir /.well-known/carddav /remote.php/dav/ 301
|
|
|
|
redir /.well-known/caldav /remote.php/dav/ 301
|
2024-12-08 22:53:40 -06:00
|
|
|
|
2024-12-19 22:37:17 -06:00
|
|
|
reverse_proxy ${localhost}:${toString service.ports.port0}
|
2024-12-08 22:53:40 -06:00
|
|
|
|
2024-12-19 22:37:17 -06:00
|
|
|
tls ${service.ssl.cert} ${service.ssl.key}
|
2024-12-08 22:53:40 -06:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-12-20 00:34:07 -06:00
|
|
|
fileSystems."${service.paths.path0}" = {
|
|
|
|
device = service.paths.path0;
|
|
|
|
fsType = "none";
|
|
|
|
options = ["bind"];
|
|
|
|
depends = [server.storage0.mount];
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.tmpfiles.rules = [
|
|
|
|
"Z ${service.paths.path0} 755 ${service.name} ${service.name} -"
|
|
|
|
];
|
2024-12-08 22:53:40 -06:00
|
|
|
}
|