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

Add 'Uninstalling Nix' section to the documentation #1624

Conversation

Munksgaard
Copy link

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

@Munksgaard
Copy link
Author

Note that nix-build release.nix -A build.x86_64-linux fails on my local machine at the moment (with this output), so someone should probably make sure it works.

rm -rf $HOME/.nix-profile
rm -rf $HOME/.nix-defexpr
rm -rf $HOME/.nix-channels
rm -rf $HOME/.config/nixpkgs
Copy link
Member

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.

Copy link
Author

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?

Copy link
Member

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
Copy link
Member

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>
Copy link
Member

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.

Copy link

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
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 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.

Copy link
Author

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.

Copy link
Author

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).

@stale
Copy link

stale bot commented Feb 12, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 12, 2021
@nixos-discourse
Copy link

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

@stale stale bot removed the stale label Jun 2, 2021
@stale
Copy link

stale bot commented Jan 3, 2022

I marked this as stale due to inactivity. → More info

@fricklerhandwerk
Copy link
Contributor

Closing this since we have some uninstall instructions by now. The only thing missing is deleting the users, which is added in #7279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add uninstall information to the manual
9 participants