dotfiles/nixos/modules/services/upRootNutrition.nix

29 lines
551 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:51:41 -06:00
root * ${service.paths.path0}
2024-12-20 00:29:03 -06:00
2024-12-20 01:18:28 -06:00
file_server
2024-12-20 00:53:48 -06:00
2024-12-20 01:18:28 -06:00
encode gzip
2024-12-08 22:53:40 -06:00
2024-12-20 01:18:28 -06:00
try_files {path} /index.html
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
}