(If the cumbersome process of manually testing changes taught you to avoid touching the installer, I suggest giving it a fresh look. It’s hard to overstate how much easier it is!)
I’ll save detail for a follow-up, but generally these light the path to:
installer support for --uninstall and reinstalling over existing installs
expanding test coverage of different install scenarios
I need to focus on other projects for a while and won’t have time for these UX/DX investments for at least a few months, but I’m happy to help others get up to speed and provide feedback.
Can the full installers from (1) be fed to install-nix-action the way numtide’s nix-unstable-installer is currently? (I ask because unstable has been rocky lately and constant new releases to update to would be helpful.)
Following up on what I think the projects/work here are. There are at least two (and maybe more) parts that can be separated if there are enough hands.
It’ll be easier with access to Linux and macOS, but it may not be essential.
I think the bulk of the work should be semi-straightforwardly applying patterns from #4289 to individual artifacts and state changed by the installer.
Shooting from the hip, but AFAIR the patterns address:
prompting the user (optionally with sudo/password for more-serious changes) for adding/removing something
showing them the change as needed
queuing reminders (next steps, notes, etc.) for presentation afterwards
granular add/remove uses the same work to support both --uninstall and reinstall (remove, add)
The “harder” problem (and the part that might be splittable?) will be figuring out what to do with/about the single-user install mode (and getting buy-in).
I think this can wait until the features work in the multi-user installer and it’s possible to demo the experience.
IIRC the outer installer targets posix sh, while the multi-user installer specifies bash.
There are many distinct cases wrt shells people use and what profile/rc files they have present.
Ideally, the test should cover starting a new shell (without inheriting env) to verify that the shell startup is working correctly.
This process may also help find conditions that the installer can be testing for and either curing or alerting the user about.
Populating distinct test-cases should be a fairly shovel-ready contribution to clarifying what does/doesn’t work and avoiding regressions. Issues filed against Nix may be a good resource for detail.
Install tests currently use install-nix-action, which IIRC limits it to multi-user installs. In order to add single-user test cases, we may need some support in install-nix-action, or a replacement mechanism dedicated to testing?
The --uninstall/reinstall work above should be able to build on top of the distinct shell/setup cases. There may be some prep work WRT to being able to validate the result of removal/reinstall.
(apologies if you follow many issues below and got thoroughly spammed by this)
To help cross-link and in case I get hit by the proverbial bus, here are some notes I compiled during #4289 of issues open at that time which I believe the project(s) described here can close:
meta point here about documenting artifacts, though. Ideally, users should be able to figure out what artifacts we add and which ones they should remove and which they should back up/keep (both, via tooling, or via docs if they’re finding cruft later)
Nix PR #3788 extended the install script to cater for distros with non-systemd init systems, so it may be prudent to add uninstall instructions for it.
(To be fair, some steps seem to have been left as an exercise for the users in this case, so the uninstall steps would be wildly different depending on the init system and user preferences… Anyway, only wanted to leave this here for completeness sake.)
I recently had to uninstall and reinstall Nix on my m1 mac. It took me quite some time, but this is everything I needed to get it removed and reinstalled.
Delete Nix Store from disk utility
Remove /nix entry from /etc/fstab (possibly optional) with sudo nano /etc/fstab
To add some background, I had Nix multi-user on my machine, but a tutorial had me install the single user version as a requirement to continue. I then realized that I need the multi-user for work, so needed to add it back but hit a ton of issues, including some of the errors below: error: the build users group 'nixbld' has no members Could not find service "org.nixos.nix-daemon" in domain for system org.nixos.nix-daemon.plist: Service is disabled
Hope this helps someone one day, maybe even future me!
EDIT - Check out the installation manual that toonn linked below, which solves every single issue here!
That’s it exactly. I was given a command to install Nix via command line, so when I hit errors, I googled them. A link in the installer about where to learn more would have saved me a ton of time. I had no idea this page existed
I’m tempted to go to all of those links and add your link back to the manual for everyone that searches later!
FWIW, I’m a new user who needed to uninstall Nix on my Mac M1. Followed the instructions multiple times, but was met with the same error each time trying to reinstall.
The instructions above from @ atayl16 worked perfectly. Not sure what the diff is between the two versions — just wanted to relay my experience. Thanks!
Could you tell us exactly what went wrong when following the uninstall instructions? If you read atayl16’s post carefully you’ll see that both of us believe the current uninstall instructions cover everything they did manually.
If the instructions are insufficient I’d like to fix that but I don’t know what the crucial difference is.