-
-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<chapter xmlns="http://docbook.org/ns/docbook" | ||
xmlns:xlink="http://www.w3.org/1999/xlink" | ||
xmlns:xi="http://www.w3.org/2001/XInclude" | ||
version="5.0" | ||
xml:id="ch-uninstalling-nix"> | ||
|
||
<title>Uninstalling Nix</title> | ||
|
||
<para>The following steps describes how to remove Nix from your system.</para> | ||
|
||
<para>First of all you need to remove the <filename>/nix</filename> | ||
directory:</para> | ||
|
||
<screen>sudo rm -rf /nix</screen> | ||
|
||
<para>You also need to remove some files from your home directory:</para> | ||
|
||
<screen> | ||
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 commentThe 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 commentThe 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 commentThe 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. |
||
</screen> | ||
|
||
<para>Then you need to remove the line that references Nix from your | ||
<filename><envar>$HOME</envar>/.profile</filename>. Assuming that your username | ||
is <literal>user</literal> it should look something like this:</para> | ||
|
||
<screen> | ||
if [ -e /home/user/.nix-profile/etc/profile.d/nix.sh ]; then . /home/user/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer | ||
</screen> | ||
|
||
<para>There might also be some configuration files in | ||
<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 commentThe reason will be displayed to describe this comment to others. Learn more. Likewise, these files do not need to be deleted. |
||
</screen> | ||
|
||
<para>Finally, on a multi-user installation of Nix, you will also need to remove | ||
the <literal>nixbld[0-9]</literal> users.</para> | ||
|
||
<screen> | ||
sudo userdel nixbld0 | ||
sudo userdel nixbld1 | ||
sudo userdel nixbld2 | ||
sudo userdel nixbld3 | ||
sudo userdel nixbld4 | ||
sudo userdel nixbld5 | ||
sudo userdel nixbld6 | ||
sudo userdel nixbld7 | ||
sudo userdel nixbld8 | ||
sudo userdel nixbld9 | ||
</screen> | ||
|
||
</chapter> |
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)