install: also configure ~/.zshenv

The default login shell for users on macOS 10.15 changed from bash to
zsh.  So while generally nonstandard we need to configure it to make nix
function out of the box on macOS.

(cherry picked from commit 10202628b9)
Signed-off-by: Domen Kožar <domen@dev.si>
This commit is contained in:
Daiderd Jordan 2019-12-15 21:11:14 +01:00 committed by Domen Kožar
parent 1c56f18a81
commit b05437f306
No known key found for this signature in database
GPG Key ID: C2FFBCAFD2C24246

View File

@ -197,6 +197,17 @@ if [ -z "$NIX_INSTALLER_NO_MODIFY_PROFILE" ]; then
break
fi
done
for i in .zshenv .zshrc; do
fn="$HOME/$i"
if [ -w "$fn" ]; then
if ! grep -q "$p" "$fn"; then
echo "modifying $fn..." >&2
echo "if [ -e $p ]; then . $p; fi # added by Nix installer" >> "$fn"
fi
added=1
break
fi
done
fi
if [ -z "$added" ]; then