nixos/lighttpd: move cgit setup to cgit.nix
To where it really belongs. Separation of concern.
commit0a2174f1952799994d053ba71b0b044c8239e2c0
authorBjørn Forsman <bjorn.forsman@gmail.com>
dateMon 25 Jul 2016, 21:22 (10 years ago)
parentd5c2785
nixos/modules/services/web-servers/lighttpd/cgit.nix+5
@@ -63,6 +63,11 @@ in
6363 }
6464 '';
6565
66+ systemd.services.lighttpd.preStart = ''
67+ mkdir -p /var/cache/cgit
68+ chown lighttpd:lighttpd /var/cache/cgit
69+ '';
70+
6671 };
6772
6873}
nixos/modules/services/web-servers/lighttpd/default.nix−6
@@ -224,12 +224,6 @@ in
224224 description = "Lighttpd Web Server";
225225 after = [ "network.target" ];
226226 wantedBy = [ "multi-user.target" ];
227− preStart = ''
228− ${if cfg.cgit.enable then ''
229− mkdir -p /var/cache/cgit
230− chown lighttpd:lighttpd /var/cache/cgit
231− '' else ""}
232− '';
233227 serviceConfig.ExecStart = "${pkgs.lighttpd}/sbin/lighttpd -D -f ${configFile}";
234228 # SIGINT => graceful shutdown
235229 serviceConfig.KillSignal = "SIGINT";