How to completely remove Nix package manager?

I installed Nix package manager, and now I would like to remove it completely.

How can I do it?


I asked myself the same question and searched the file system for Nix-related files. That's what I found:

# as user, remove:
rm -r ~/.nix-channels ~/.nix-defexpr ~/.nix-profile
# as root (sudo), remove:
sudo rm -r /nix
# edit the file ~/.profile and remove the line containing "added by Nix installer"

Not sure if I missed some files or directories. Also, I did not remove it myself, so be careful (and backup your data!) when removing stuff with sudo.