Description
---- warning! ------------------------------------------------------------------
Nix already appears to be installed. This installer may run into issues.
If an error occurs, try manually uninstalling, then rerunning this script.
Uninstalling nix:
-
Remove macOS-specific components:
-
Uninstall LaunchDaemon org.nixos.nix-daemon
sudo launchctl bootout system/org.nixos.nix-daemon
sudo rm /Library/LaunchDaemons/org.nixos.nix-daemon.plist
-
-
Restore /etc/bashrc.backup-before-nix back to /etc/bashrc
sudo mv /etc/bashrc.backup-before-nix /etc/bashrc
(after this one, you may need to re-open any terminals that were
opened while it existed.)
- Restore /etc/zshrc.backup-before-nix back to /etc/zshrc
sudo mv /etc/zshrc.backup-before-nix /etc/zshrc
(after this one, you may need to re-open any terminals that were
opened while it existed.)
- Delete the files Nix added to your system:
sudo rm -rf "/etc/nix" "/nix" "/var/root/.nix-profile" "/var/root/.nix-defexpr" "/var/root/.nix-channels" "/var/root/.local/state/nix" "/var/root/.cache/nix" "/Users/dany/.nix-profile" "/Users/dany/.nix-defexpr" "/Users/dany/.nix-channels" "/Users/dany/.local/state/nix" "/Users/dany/.cache/nix"
and that is it.
---- 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.
Here's how to clean up the old backup file:
-
Back up (copy) /etc/bashrc and /etc/bashrc.backup-before-nix
to another location, just in case. -
Ensure /etc/bashrc.backup-before-nix does not have anything
Nix-related in it. If it does, something is probably quite
wrong. Please open an issue or get in touch immediately. -
Once you confirm /etc/bashrc is backed up and
/etc/bashrc.backup-before-nix doesn't mention Nix, run:
mv /etc/bashrc.backup-before-nix /etc/bashrc
We'd love to help if you need it.
You can open an issue at
https://github.com/NixOS/nix/issues/new?labels=installer&template=installer.md
Or get in touch with the community: https://nixos.org/community