1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-04-08 18:20:48 +00:00

Merge pull request #509 from malob/fix-warning-about-HOME

Add `-H` to `sudo nix-env [...]` calls in `darwin-rebuild.sh` to deal with warning
This commit is contained in:
Domen Kožar 2022-08-30 19:56:26 +02:00 committed by GitHub
commit db543d325f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
@ -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