summary refs log tree commit diff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-04-29 13:30:09 -0400
committerBen Gamari <ben@smart-cactus.org>2018-04-29 13:32:02 -0400
commit7d68eadf373f9962b0e6c9f9299563c543245396 (patch)
tree78b93368a65539d798c626cfc62822751afa0b55
parent7139c65c88bb24095fac1af34a1e4780eb224dfd (diff)
downloadnixlib-7d68eadf373f9962b0e6c9f9299563c543245396.tar
nixlib-7d68eadf373f9962b0e6c9f9299563c543245396.tar.gz
nixlib-7d68eadf373f9962b0e6c9f9299563c543245396.tar.bz2
nixlib-7d68eadf373f9962b0e6c9f9299563c543245396.tar.lz
nixlib-7d68eadf373f9962b0e6c9f9299563c543245396.tar.xz
nixlib-7d68eadf373f9962b0e6c9f9299563c543245396.tar.zst
nixlib-7d68eadf373f9962b0e6c9f9299563c543245396.zip
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`.
-rw-r--r--nixos/modules/security/acme.nix8
1 files 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)"