nixos/nginx: always run systemctl of the currently running systemd

Also, make the postRun script refer to that systemctl, and not just rely
on $PATH for consistency.
This commit is contained in:
Florian Klink 2020-05-21 10:31:26 +02:00
parent 1955982190
commit a3678ed347

View File

@ -756,9 +756,9 @@ in
serviceConfig.Type = "oneshot";
serviceConfig.TimeoutSec = 60;
script = ''
if ${pkgs.systemd}/bin/systemctl -q is-active nginx.service ; then
if /run/current-system/systemd/bin/systemctl -q is-active nginx.service ; then
${execCommand} -t && \
${pkgs.systemd}/bin/systemctl reload nginx.service
/run/current-system/systemd/bin/systemctl reload nginx.service
fi
'';
serviceConfig.RemainAfterExit = true;
@ -772,7 +772,7 @@ in
webroot = vhostConfig.acmeRoot;
extraDomains = genAttrs vhostConfig.serverAliases (alias: null);
postRun = ''
systemctl reload nginx
/run/current-system/systemd/bin/systemctl reload nginx
'';
}; }) acmeEnabledVhosts;
in