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

doc: Add detailed uninstall section for macOS #6144

Merged
merged 4 commits into from
Mar 23, 2022

Conversation

toonn
Copy link
Contributor

@toonn toonn commented Feb 22, 2022

The multi-user installation on macOS, which is now the only option, has
gotten complicated enough that it discourages some users from checking
Nix out for fear of being left with a "dirty" system. Detailed
uninstallation instructions should make this less of an issue.

Note:
I left the Linux uninstall instructions unchanged but I suspect they could use a similar revamp wrt removing build users at least.

The multi-user installation on macOS, which is now the only option, has
gotten complicated enough that it discourages some users from checking
Nix out for fear of being left with a "dirty" system. Detailed
uninstallation instructions should make this less of an issue.
@abathur
Copy link
Member

abathur commented Feb 22, 2022

Two thoughts (beyond how much this will help!):

  1. This won't be universally true. I'm not entirely sure how to communicate the asterisks to the reader...

    1. I'm not 100% certain, but I don't think the installer will create the volume/synthetic.conf/fstab/mounter if the root is writable (so, pre-Catalina).

      (I have thought it might be worth seeing if the older systems would support the components of this to wring more variety out of the install base, but unless it Just Works, it could mean a lot of effort for an unknown-but-probably-small number of installs--and we'd still have legacy installs.)

    2. Even on Catalina+, people with older installs (up through mid fall?) may not have the the mounter. Some inevitably still have single-user installs.

  2. Almost noted this inline, but I'm dithering a little about placement (at the end of 5? at the end of 7? after the list as now?). It might help for the note on the empty mount dir to be more explicit?

    Not sure this is right; just sketching...

    Note: After you complete the steps here, you will still have an empty /nix directory. This is an expected sign of a successful uninstall. The empty /nix directory will disappear the next time you reboot.

    You do not have to reboot to finish uninstalling Nix. The uninstall is complete, but macOS (Catalina+) directly controls root directories--its read-only root will prevent you from manually deleting the empty /nix mountpoint.

@toonn
Copy link
Contributor Author

toonn commented Feb 23, 2022

Definitely valid points.

Do we want to explicitly address uninstall on older versions or do we leave that up to readers to figure out from the newer instructions? The main difference is the store so it wouldn't be too hard to figure out that can simply be removed.

That's a good clarification in the note. Should this be a footnote or inline?

@abathur
Copy link
Member

abathur commented Feb 23, 2022

Do we want to explicitly address uninstall on older versions or do we leave that up to readers to figure out from the newer instructions? The main difference is the store so it wouldn't be too hard to figure out that can simply be removed.

I'll chew on this a little. I just read the diff before, but I want to go back to read the full page to make sure I'm fresh on how it addresses single/multi linux/mac.

That's a good clarification in the note. Should this be a footnote or inline?

Happy to go with your gut if you like the text. I started writing it for the end of step 5, but I started to worry that just mentioning reboot at the end of 5 would make some number of people misread and try rebooting, which would then break step 7. So, by the end, I was thinking it might replace the paragraph after 7?

Comment on lines 134 to 135
sudo launchctl unload /Library/LaunchDaemons/org.nixos.activate-system.plist
sudo rm /Library/LaunchDaemons/org.nixos.activate-system.plist
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the nix-darwin service, yeah? did you mean to use that one instead of the mount daemon?

(I was reading over all of this and thinking maybe we could get away with adding a few qualifiers to a few of these steps to say something like "You may not have X if you if you are running macOS Mojave (or earlier), or if you installed Nix before Y.")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you're right of course. I was originally writing the instructions from a "I want to get rid of all things Nix," point of view but this would be more suited to the nix-darwin manual.

Maybe we can use the fstab step as the first differentiating step and add a note along the lines of "If you don't have this entry you probably have an older install on a pre-Catalina macOS, you won't have to do steps X, Y and Z and you should rm /nix instead?"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, similar to what you say in the very next comment but just localized to the first step where someone might notice a difference.

Alternatively we could make all the post-Catalina steps a sublist of a single step and then we can say to just skip the one step. Keeping them at the top-level list is slightly more flexible, the current order is based on not ending up with a broken setup at any point and going from easy to un-undo to harder to un-undo. However, I do think we could do all the post-Catalina specific stuff grouped.

@abathur
Copy link
Member

abathur commented Feb 24, 2022

Do we want to explicitly address uninstall on older versions or do we leave that up to readers to figure out from the newer instructions? The main difference is the store so it wouldn't be too hard to figure out that can simply be removed.

I'll chew on this a little. I just read the diff before, but I want to go back to read the full page to make sure I'm fresh on how it addresses single/multi linux/mac.

I am not sure we actually need to address it. I don't really know how many of these systems would plausibly be left? I think it could be as simple as a note at the beginning. Something like:

Note:

  1. If you are running macOS Mojave (10.14) or earlier, you will have a simple /nix root directory instead of a Nix Store volume. Specifically, this means:
    • you will not have the nix-store LaunchDaemon removed in step 2
    • you can skip steps 4, 5, and 7
    • after step 6, you should also run sudo rm -rf /nix
  2. If you first installed Nix before November 2021 (Nix versions earlier than 2.4) you will not have the nix-store LaunchDaemon removed in step 2.

That said, 0 complaints from me if you think these are too rare in the real-world to allocate this many vertical lines to... 🤿

@edolstra
Copy link
Member

edolstra commented Feb 24, 2022

Ideally, we would have an uninstall script that does these things automatically. Maybe we can put these commands in a script (possibly the installer, under a --uninstall flag)?

@abathur
Copy link
Member

abathur commented Feb 24, 2022

Ideally, we would have an uninstall script that does these things automatically. Maybe we can put these commands in a script (possibly the installer, under a --uninstall flag)?

@edolstra Strong agree on the "ideally" part, though I think ideal shouldn't be the enemy of better, here. (I already let that happen once myself.) :)

General thoughts:

I have some more thoughts but need to run for now...

toonn and others added 2 commits February 25, 2022 10:32
Clarify that `/nix` being present after the uninstall is normal and it
will only disappear after a reboot.

Co-authored-by: Travis A. Everett <travis.a.everett@gmail.com>
@toonn
Copy link
Contributor Author

toonn commented Feb 25, 2022

@edolstra, totally agree that an uninstall command would be the way to go. Not the easiest to version since ideally a newer installer could still uninstall an older Nix but a great goal none the less. I'm not so sure a simple uninstall script containing these commands would we be good enough, however, making it available to copy all at once might be useful, should I add this to the docs? I could make the entire section a script with comments if that's considered useful.

The uninstall instructions used to accidentally remove the nix-darwin
LaunchDaemon, this was dropped. However, the original intent was to
remove the Store volume mounting LaunchDaemon.
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nix-macos-monthly/12330/17

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

Successfully merging this pull request may close these issues.

5 participants