From 7d68eadf373f9962b0e6c9f9299563c543245396 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Sun, 29 Apr 2018 13:30:09 -0400 Subject: [PATCH] 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`. --- nixos/modules/security/acme.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nixos/modules/security/acme.nix b/nixos/modules/security/acme.nix index e430c2ddb903..9e5d636241e9 100644 --- a/nixos/modules/security/acme.nix +++ b/nixos/modules/security/acme.nix @@ -257,7 +257,7 @@ in if [ -e /tmp/lastExitCode ] && [ "$(cat /tmp/lastExitCode)" = "0" ]; then ${if data.activationDelay != null then '' - + ${data.preDelay} if [ -d '${lpath}' ]; then @@ -266,6 +266,10 @@ in systemctl --wait start acme-setlive-${cert}.service fi '' else data.postRun} + + # noop ensuring that the "if" block is non-empty even if + # activationDelay == null and postRun == "" + true fi ''; @@ -294,7 +298,7 @@ in chown '${data.user}:${data.group}' '${cpath}' fi ''; - script = + script = '' workdir="$(mktemp -d)"