Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS upgrade after fresh initial nix install: zshrc additions vanish #6117

Open
permezel opened this issue Feb 18, 2022 · 1 comment
Open

Comments

@permezel
Copy link

Describe the bug
Performed macOS upgrade from 12.${PREVIOUS} to 12.2.1, just after I installed nix.
On reboot, the /etc/zshrc settings had vanished. I added the nix bin to the PATH and ran nix doctor and it found no issues. I tried reinstalling nix and it crapped out.

Steps To Reproduce

  1. Install nix 2.6.1 on macOS
  2. Perform system upgrade
  3. Login, and try to run nix
  4. Fails, due to $PATH additions having been lost
  5. Manually prepend nix bin to PATH
  6. run nix doctor -- no output
  7. Try to reinstall
  8. Ponder meaning of oh no

Expected behavior

I expect the initial nix install to have made some addition to the /etc/{z,ba}shrc files somehow (and that's the question here: how?) that survives a system upgrade which appears to have clobbered the changes.

Or, perhaps, nix doctor to fix things.

nix-env --version output
nix-env (Nix) 2.6.1

Additional context

Add any other context about the problem here.

---- oh no! --------------------------------------------------------------------
I back up shell profile/rc scripts before I add Nix to them.
I need to back up /etc/bashrc to /etc/bashrc.backup-before-nix,
but the latter already exists.
sloth% ls -lrt /etc/{z,ba}shrc*
-rw-r--r--  1 root  wheel  9335  7 Feb 07:22 /etc/zshrc_Apple_Terminal
-r--r--r--  1 root  wheel  3094  7 Feb 07:22 /etc/zshrc
-rw-r--r--  1 root  wheel  9309  7 Feb 07:22 /etc/bashrc_Apple_Terminal
-r--r--r--  1 root  wheel   265 18 Feb 19:33 /etc/bashrc.backup-before-nix
-r--r--r--  1 root  wheel   426 18 Feb 19:33 /etc/bashrc
-r--r--r--  1 root  wheel  3094 18 Feb 19:33 /etc/zshrc.backup-before-nix
sloth% md5sum /etc/zshrc /etc/zshrc.backup-before-nix     
5c21be339555680489cc7448c92acc18  /etc/zshrc
5c21be339555680489cc7448c92acc18  /etc/zshrc.backup-before-nix

The bash additions are still there:

sloth% diff /etc/bashrc /etc/bashrc.backup-before-nix 
11,17d10
< 
< # Nix
< if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
<   . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
< fi
< # End Nix
< 

I have fixed the issue, but it required re-installing.

@permezel permezel added the bug label Feb 18, 2022
@permezel permezel changed the title macOS upgrade after fresh initial nix install: bash and zsh additions vanish macOS upgrade after fresh initial nix install: zshrc additions vanish Feb 18, 2022
@abathur
Copy link
Member

abathur commented Feb 19, 2022

Same issue as #3616

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants