Skip to content

Commit

Permalink
Merge pull request #509 from malob/fix-warning-about-HOME
Browse files Browse the repository at this point in the history
Add `-H` to `sudo nix-env [...]` calls in `darwin-rebuild.sh` to deal with warning
  • Loading branch information
domenkozar authored Aug 30, 2022
2 parents be1b986 + 1da877d commit db543d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkgs/nix-tools/darwin-rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ fi

if [ "$action" = list ] || [ "$action" = rollback ]; then
if [ "$USER" != root ] && [ ! -w $(dirname "$profile") ]; then
sudo nix-env -p "$profile" "${extraProfileFlags[@]}"
sudo -H nix-env -p "$profile" "${extraProfileFlags[@]}"
else
nix-env -p "$profile" "${extraProfileFlags[@]}"
fi
Expand All @@ -178,7 +178,7 @@ if [ -z "$systemConfig" ]; then exit 0; fi

if [ "$action" = switch ]; then
if [ "$USER" != root ] && [ ! -w $(dirname "$profile") ]; then
sudo nix-env -p "$profile" --set "$systemConfig"
sudo -H nix-env -p "$profile" --set "$systemConfig"
else
nix-env -p "$profile" --set "$systemConfig"
fi
Expand Down

0 comments on commit db543d3

Please sign in to comment.