dotfiles/nixos/modules/services/upRootNutrition.nix
2024-12-20 01:18:28 -06:00

30 lines
676 B
Nix
Executable file

{flake, ...}: let
inherit (flake.config.services.instances) upRootNutrition web;
service = upRootNutrition;
# localhost = web.localhost.address0;
host = web.domains.url3;
in {
services = {
caddy = {
virtualHosts = {
"${host}" = {
extraConfig = ''
# Root directory where your compiled Elm files are located
root * ${service.path.path0}
file_server
encode gzip
try_files {path} /index.html
tls ${service.ssl.cert} ${service.ssl.key}
'';
};
};
};
};
systemd.tmpfiles.rules = [
"Z ${service.paths.path0} 755 caddy caddy -"
];
}