fix: create log folders

hachino-test
Pyjacpp 2026-07-19 19:38:23 +02:00
parent 3575c130ae
commit 11b39e46a1
No known key found for this signature in database
GPG Key ID: ED479A5A26930939
1 changed files with 15 additions and 0 deletions

View File

@ -147,6 +147,21 @@ in
group = config.services.nginx.group;
};
# Création des dossiers de logs
system.activationScripts = {
nginx-logs = {
text =
lib.concatMapStrings (f: "mkdir -p /var/log/nginx/${f}/\n") (
[
"anubis"
"aliases"
]
++ (lib.map (hn: "host/${hn}") (builtins.attrNames cfg.virtualHosts))
)
+ "chown -R ${config.services.nginx.user}:${config.services.nginx.group} /var/log/nginx/\n";
};
};
services = mkIf cfg.enable {
anubis = {
defaultOptions.group = "nginx";