git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/acme: Fix broken post-stop script

Previously the script would contain an empty `if` block (which is invalid syntax) if both `data.activationDelay == null` and `data.postRun == ""`. Fix this by adding a no-op `true`.

commit7d68eadf373f9962b0e6c9f9299563c543245396 authorBen Gamari <ben@smart-cactus.org> dateSun 29 Apr 2018, 13:30 (9 years ago) parent7139c65
1 file changed+6−2
nixos/modules/security/acme.nix+6−2
nixos/modules/security/acme.nix+6−2
@@ -257,7 +257,7 @@ in
257257
258258 if [ -e /tmp/lastExitCode ] && [ "$(cat /tmp/lastExitCode)" = "0" ]; then
259259 ${if data.activationDelay != null then ''
260−
260+
261261 ${data.preDelay}
262262
263263 if [ -d '${lpath}' ]; then
@@ -266,6 +266,10 @@ in
266266 systemctl --wait start acme-setlive-${cert}.service
267267 fi
268268 '' else data.postRun}
269+
270+ # noop ensuring that the "if" block is non-empty even if
271+ # activationDelay == null and postRun == ""
272+ true
269273 fi
270274 '';
271275
@@ -294,7 +298,7 @@ in
294298 chown '${data.user}:${data.group}' '${cpath}'
295299 fi
296300 '';
297− script =
301+ script =
298302 ''
299303 workdir="$(mktemp -d)"
300304