1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

treewide: deprecate DRY_RUN_CMD and DRY_RUN_NULL

As a replacement, this adds the `run` helper function.
This commit is contained in:
Robert Helgesson 2024-01-13 23:15:00 +01:00
parent 6b28ab2d79
commit 4256729006
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
25 changed files with 125 additions and 67 deletions

View file

@ -115,7 +115,7 @@ function nixProfileRemove() {
nixProfileList "$1" | xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG
else
if nix-env -q | grep -q "^$1$"; then
$DRY_RUN_CMD nix-env -e "$1" > $DRY_RUN_NULL 2>&1
run --silence nix-env -e "$1"
fi
fi
}
@ -161,6 +161,9 @@ nix-env -q > /dev/null 2>&1 || true
migrateProfile
setupVars
# Note, the DRY_RUN_CMD and DRY_RUN_NULL variables are deprecated and should not
# be used inside the Home Manager project. They are provided here for backwards
# compatibility.
if [[ -v DRY_RUN ]] ; then
_i "This is a dry run"
export DRY_RUN_CMD=echo