dotfiles/nixos/modules/services/website/default.nix

34 lines
581 B
Nix
Raw Normal View History

2025-02-05 20:15:36 -06:00
{ flake, ... }:
let
inherit (flake.config.services.instances)
2025-01-08 19:06:14 -06:00
upRootNutrition
web
;
2024-12-08 22:53:40 -06:00
service = upRootNutrition;
host = web.domains.url3;
2025-02-05 20:15:36 -06:00
in
{
2024-12-08 22:53:40 -06:00
services = {
caddy = {
virtualHosts = {
"${host}" = {
extraConfig = ''
2024-12-20 02:00:12 -06:00
root * ${service.paths.path0}
2024-12-20 01:18:28 -06:00
file_server
2024-12-20 02:00:12 -06:00
2024-12-20 01:18:28 -06:00
encode gzip
2024-12-20 02:00:12 -06:00
2024-12-20 01:18:28 -06:00
try_files {path} /index.html
2024-12-20 02:00:12 -06:00
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
}