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

Handle case of MacOS updates to /etc/*rc more gracefully #7781

Open
jonringer opened this issue Jul 22, 2022 · 3 comments
Open

Handle case of MacOS updates to /etc/*rc more gracefully #7781

jonringer opened this issue Jul 22, 2022 · 3 comments

Comments

@jonringer
Copy link
Contributor

Introduce your stance
(I think the installer is part of this repo)

MacOS reserves the right to update /etc/bash.bashrc and /etc/zshrc. The problem is that these are destructive updates and causes the related files to revert the changes done by the nix installation.

Until mac supports /etc/zshrc.d/, we should probably have the installer handle the case that a /etc/*rc file was overwritten by mac.

Describe the issue
Explained above.

We should probably check if /etc/{bash.bash,zsh}rc contain nix, if they don't then use that as the new $file.backup-before-nix file, if they do contain references to nix, then skip attempting to modify it.

For the MacOS 12.3 case, the following would have been needed (copied from here):

# 1. Remove backup files
sudo rm /etc/{bashrc,zshrc}.backup-before-nix

# 2. Run installation script again
sh <(curl -L https://nixos.org/nix/install)

# Doing 2. before 1. makes the installation script fail.
@jonringer
Copy link
Contributor Author

Related issues: #3616 #2280

@fricklerhandwerk
Copy link
Contributor

@jonringer The installer is part of NixOS/nix.

@timfenney
Copy link
Contributor

@fricklerhandwerk does this issue need to be moved?

@fricklerhandwerk fricklerhandwerk transferred this issue from NixOS/nixos-homepage Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants