How to reinstall Home Manager?

Hello! I wanted to switch to “standalone” option of home-manager from “nixos module”, so I deleted some lines from my configuration.nix and accidentally ran nix-shell '<home-manager>' -A install with sudo. Therefore my home.nix is located in my root directory now instead user. Could you please tell me how I can remove it to reinstall without sudo?

Thanks in advance!

Just run the command as your user.

Still you probably should uninstall as root, though uninstallastion is undocumented.

For your usecase it should be enough to sudo nix-env -e home-manager-path to make sure that all the programs that are installed by HM already get removed from roots packages.

2 Likes