Skip to content

Commit

Permalink
create missing profile files to fix zsh envvars
Browse files Browse the repository at this point in the history
Env vars for ZSH were moved from /etc/zshrc to /etc/zshenv in NixOS#3608
to address an issue with zshrc getting clobbered by OS updates, but
/etc/zshenv doesn't exist by default--so *nothing* would get set up
for zsh users unless they already happened to have /etc/zshenv.

Tentatively trying creating these files if they don't exist...
  • Loading branch information
abathur committed Sep 12, 2020
1 parent 867e8c3 commit 88341ae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/install-multi-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,16 @@ configure_shell_profile() {
if [ -e "$profile_target" ]; then
_sudo "to back up your current $profile_target to $profile_target$PROFILE_BACKUP_SUFFIX" \
cp "$profile_target" "$profile_target$PROFILE_BACKUP_SUFFIX"
else
# try to create the file if its directory exists
target_dir="$(dirname "$profile_target")"
if [ -d "$target_dir" ]; then
_sudo "to create a stub $profile_target which will be updated" \
touch "$profile_target"
fi
fi

if [ -e "$profile_target" ]; then
shell_source_lines \
| _sudo "extend your $profile_target with nix-daemon settings" \
tee -a "$profile_target"
Expand Down

0 comments on commit 88341ae

Please sign in to comment.