I installed home-manager as a flake because it felt right the most. Later on, it encountered an error that I didn’t really want to deal with. Thus, I have removed the home-manger code from my flake.nix.
I then realized that home-manager via flake is experimental.
Home Manager is compatible with Nix Flakes. But please be aware that this support is still experimental and may change in backwards incompatible ways.
I installed and made configurations to a few applications that were on my home.nix. The applications and their configurations persists after removing the home-manager code and doing nh os boot -u .
When i do nix profile list, it shows a few home-manager paths in the nix store.
How to remove home-manager completely, including those applications + configs in my home.nix?
I will re-install home-manager again, so is the installing home-manager not via flakes the best option?
In this case you can’t use it’s built-in uninstaller and have to manually wipe generated profiles and find the symlinks it generated in your home folder and delete them. It might also be necessary to remove home-manager-path once from your users default profile.
Perhaps you should remove flake as well, this is still experimental. Now, just fyi, I use both of these experimental features since years without any troubles.
As flakes are experimental, something based on it has to be experimental as well.
And IMHO that is here exactly the point for home-manager.
It’s just saying that it might change in a breaking way in the future and that is then because of changes for flakes, if they occur at some point in the time (or never)
HM can be installed standalone or as a system module, either can be done using flakes or without it. Whether you used flakes or not is not the significant difference in installation. Whether you use nixos-rebuild or home-manager CLI to apply home config is what makes the difference. Or as you mentioned nh, the difference is whether you use nh os or nh home to apply your HM config.
I think it’s all just in ~/.local/state/nix/profiles and ~/.local/state/home-manager/gcroots/. Delete the profile symlinks you don’t want, then recover the disk space with nix-collect-garbage.
You might need to login/logout if there was an active activation of a home-manager generation so that the process gcroot also gets cleared.
If you have something in you .bash_profile or .profile that activates home-manager scripts, you’ll probably want to remove that too.
# snippet from my bash_profile
# source nix home-manager scripts
if [ -d "${HOME}/.nix-profile/etc/profile.d" ]; then
for script in "${HOME}/.nix-profile/etc/profile.d/*.{,ba}sh"; do
if [ -f "$script" ]; then
. "$script"
fi
done
unset script
fi
Did you import home-manager.nixosModules.default or something into your system config, or did you create a dedicated homeConfigs.harlequin output calling home-manager.lib.homeManagerConfiguration?