dotfiles/nixos/modules/services/upRootNutrition.nix

30 lines
711 B
Nix
Raw Normal View History

2024-12-19 22:37:17 -06:00
{flake, ...}: let
2024-12-08 22:53:40 -06:00
inherit (flake.config.services.instances) upRootNutrition web;
service = upRootNutrition;
2024-12-20 01:18:28 -06:00
# localhost = web.localhost.address0;
2024-12-08 22:53:40 -06:00
host = web.domains.url3;
in {
services = {
caddy = {
virtualHosts = {
"${host}" = {
extraConfig = ''
2024-12-20 01:59:20 -06:00
log {
level DEBUG
output file /var/log/caddy/access.log
}
root * ${service.path.path0}
2024-12-20 01:18:28 -06:00
file_server
encode gzip
try_files {path} /index.html
2024-12-20 01:59:20 -06:00
tls ${service.ssl.cert} ${service.ssl.key}
2024-12-08 22:53:40 -06:00
'';
};
};
};
};
2024-12-20 01:18:28 -06:00
systemd.tmpfiles.rules = [
"Z ${service.paths.path0} 755 caddy caddy -"
];
2024-12-08 22:53:40 -06:00
}