activation.nix: fix for "activation from build result" (revised)

Solve #111
This commit is contained in:
Shamrock Lee 2021-09-20 11:14:03 +00:00 committed by Alexander Sosedkin
parent d0b83e6397
commit 6b9e3fbbec

View file

@ -35,9 +35,9 @@ let
set -eu set -eu
set -o pipefail set -o pipefail
cd $HOME
export PATH="${activationBinPaths}" export PATH="${activationBinPaths}"
_NOD_GENERATION_DIR="$(realpath "$(dirname "$0")")"
cd "$HOME"
${builtins.readFile ../lib-bash/color-echo.sh} ${builtins.readFile ../lib-bash/color-echo.sh}
${builtins.readFile ../lib-bash/activation-init.sh} ${builtins.readFile ../lib-bash/activation-init.sh}
@ -133,7 +133,7 @@ in
if [[ $generationDir =~ ^${profileDirectory}-([0-9]+)-link$ ]]; then if [[ $generationDir =~ ^${profileDirectory}-([0-9]+)-link$ ]]; then
$DRY_RUN_CMD nix-env --profile "${profileDirectory}" --switch-generation "''${BASH_REMATCH[1]}" $DRY_RUN_CMD nix-env --profile "${profileDirectory}" --switch-generation "''${BASH_REMATCH[1]}"
else else
$DRY_RUN_CMD nix-env --profile "${profileDirectory}" --set "$(realpath "$generationDir")" $DRY_RUN_CMD nix-env --profile "${profileDirectory}" --set "$_NOD_GENERATION_DIR"
fi fi
''; '';