lighttpd: restart service if config changes
Using /etc/lighttpd.conf "hides" the config file from NixOS so that it will not automatically restart the service when its config file changes. So don't do that.
This commit is contained in:
parent
f40a38b2c8
commit
395bc5d05c
@ -7,6 +7,9 @@ with pkgs.lib;
|
||||
let
|
||||
|
||||
cfg = config.services.lighttpd;
|
||||
configFile = pkgs.writeText "lighttpd.conf" ''
|
||||
${cfg.configText}
|
||||
'';
|
||||
|
||||
in
|
||||
|
||||
@ -64,21 +67,11 @@ in
|
||||
description = "Lighttpd Web Server";
|
||||
after = [ "network.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
|
||||
serviceConfig.KillSignal = "SIGINT";
|
||||
};
|
||||
|
||||
environment.etc =
|
||||
[
|
||||
{ source = pkgs.writeText "lighttpd.conf"
|
||||
''
|
||||
${cfg.configText}
|
||||
'';
|
||||
target = "lighttpd.conf";
|
||||
}
|
||||
];
|
||||
|
||||
users.extraUsers.lighttpd = {
|
||||
group = "lighttpd";
|
||||
description = "lighttpd web server privilege separation user";
|
||||
|
Loading…
Reference in New Issue
Block a user