From baf04cc75db443f8ba3a5cf20bde1142113b77d7 Mon Sep 17 00:00:00 2001 From: James Andariese Date: Tue, 27 Sep 2022 11:17:40 -0500 Subject: [PATCH] fix binbash module to use mkIf properly --- common/bash-is-needed.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/common/bash-is-needed.nix b/common/bash-is-needed.nix index a61f779..ec12c4d 100644 --- a/common/bash-is-needed.nix +++ b/common/bash-is-needed.nix @@ -23,15 +23,16 @@ with lib; }; config = { - system.activationScripts.binbash = if config.environment.binbash.enable - then '' + system.activationScripts.binbash = mkMerge [ + (mkIf config.environment.binbash.enable '' mkdir -m 0755 -p /bin ln -sfn ${config.environment.binbash.bash}/bin/bash /bin/.bash.tmp - mv /bin/.bash.tmp /bin/bash # atomically replace /usr/bin/env - '' - else '' + mv /bin/.bash.tmp /bin/bash # atomically replace + '') + (mkIf (! config.environment.binbash.enable) '' rm -f /bin/bash - ''; + '') + ]; }; }