-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add 'Uninstalling Nix' section to the documentation #1624
Add 'Uninstalling Nix' section to the documentation #1624
Conversation
Note that |
rm -rf $HOME/.nix-profile | ||
rm -rf $HOME/.nix-defexpr | ||
rm -rf $HOME/.nix-channels | ||
rm -rf $HOME/.config/nixpkgs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files do not need to be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But shouldn't they be? If I was testing out some new software on my machine, I wouldn't want it to leave behind unnecessary files or directories. Perhaps we could move these commands into a sub-section describing how to completely purge Nix from your system?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be better to have a section which lists all files that are (typically) existing/generated by Nix and what their purpose is. Based on that a reader can easily decide what they need to remove.
<filename>/etc/nix</filename> that you need to delete:</para> | ||
|
||
<screen> | ||
sudo rm -rf /etc/nix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, these files do not need to be deleted.
<para>First of all you need to remove the <filename>/nix</filename> | ||
directory:</para> | ||
|
||
<screen>sudo rm -rf /nix</screen> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and removing the sourcing of nix-profile.sh are really the only steps that are required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does one remove the nix-profile.sh on osx, how do I locate it from the terminal (if that's what I am using)
the <literal>nixbld[0-9]</literal> users.</para> | ||
|
||
<screen> | ||
sudo deluser nixbld0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is system-specific. On NixOS (and I think most Linux distributions) the command is userdel
. Also it can be more elegantly expressed using a for loop, e.g. for $((i = 0; i < 10; i++)); do deluser nixbld$i; done
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I'll update the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, strictly speaking, that for loop is also system-specific, isn't it? It doesn't work in my shell (fish).
I marked this as stale due to inactivity. → More info |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/anyone-up-for-picking-at-some-nix-onboarding-improvements/13152/6 |
I marked this as stale due to inactivity. → More info |
Closing this since we have some uninstall instructions by now. The only thing missing is deleting the users, which is added in #7279 |
The purpose of this PR is to make it easier to figure out how to uninstall Nix. It's very likely that I'm missing some details, especially with regards to multi-user installs, but I think this PR should serve as a good starting point. It condenses information from #458 and #1402 and adds a new section in the manual.
Fixes #1623