Uninstalling Nix on macOS

There is not an official tool yet (though I’m not sure an uninstall is necessary, in your case?)

This is very frequently requested. I’ve laid out roughly what I think it would take to be able to add an --uninstall flag to the installer in Anyone up for picking at some Nix ~onboarding improvements? and Installer test suite? :) small project(s), high-leverage, help wanted but I am not aware of anyone currently working on any of them.

IIRC the reboot step is just for macOS to clean up the empty root /nix directory (some people get confused when they follow uninstall steps and still see the /nix directory, then throw a fit about the uninstall steps not working). I’ll give more detail than you probably need in case others land here via search:

  • There’s no way around needing to reboot to have macOS remove the directory that I am aware of. It isn’t friendly, but it’s a system limitation we have to live with (unless/until Apple add some way for us to imperatively clean it up).
  • You can skip the reboot step if you understand the consequences. If you:
    • do not plan to reinstall, you understand that you’ll have a /nix directory hanging around until your next reboot.
    • plan to then install Nix 2.3.x: go ahead and reboot. IIRC the 2.3.x installer will be confused by the presence of the /nix directory and the install will fail.
    • plan to then install Nix 2.4.x (prerelease or release): you shouldn’t need to reboot. This installer should not be confused by the dangling directory.
2 Likes