From 395bc5d05c98dcc65ac239540988b83182276c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sun, 31 Mar 2013 16:10:06 +0200 Subject: [PATCH] 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. --- modules/services/web-servers/lighttpd.nix | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/modules/services/web-servers/lighttpd.nix b/modules/services/web-servers/lighttpd.nix index 35a9ca78a59d..1931fa65e515 100644 --- a/modules/services/web-servers/lighttpd.nix +++ b/modules/services/web-servers/lighttpd.nix @@ -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";