Merge branch 'lighttpd' of git://github.com/bjornfor/nixos into upstream-master

Moves config file into the store rather than polluting etc, which has a
number of benefits

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2013-04-01 13:09:23 -04:00
commit cf3ef6a1fc

View File

@ -7,6 +7,9 @@ with pkgs.lib;
let let
cfg = config.services.lighttpd; cfg = config.services.lighttpd;
configFile = pkgs.writeText "lighttpd.conf" ''
${cfg.configText}
'';
in in
@ -64,21 +67,11 @@ in
description = "Lighttpd Web Server"; description = "Lighttpd Web Server";
after = [ "network.target" ]; after = [ "network.target" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig.ExecStart = "${pkgs.lighttpd}/sbin/lighttpd -D -f /etc/lighttpd.conf"; serviceConfig.ExecStart = "${pkgs.lighttpd}/sbin/lighttpd -D -f ${configFile}";
# SIGINT => graceful shutdown # SIGINT => graceful shutdown
serviceConfig.KillSignal = "SIGINT"; serviceConfig.KillSignal = "SIGINT";
}; };
environment.etc =
[
{ source = pkgs.writeText "lighttpd.conf"
''
${cfg.configText}
'';
target = "lighttpd.conf";
}
];
users.extraUsers.lighttpd = { users.extraUsers.lighttpd = {
group = "lighttpd"; group = "lighttpd";
description = "lighttpd web server privilege separation user"; description = "lighttpd web server privilege separation user";