Program (Alacritty) stays installed after removing from configuration and rebuilding

I used to have Alacritty installed, but opted to just use xfce4-terminal instead.
So I removed alacritty from my environment.systemPackages, and did “sudo nixos-rebuild switch --upgrade” and “sudo nix-collect-garbage -d” and have done this several times, and have rebooted several times as well. I also ran these commands as user, in case that somehow would do anything.

I am suspecting home manager is to blame here. At one point, I used home manager, and had alacritty enabled there. I decided to not use home manager anyway, and removed it from my configuration and from my channels. But it seems like Alacritty is still being installed (or left) by home manager.

When I run “sudo find / -iname alacritty”, this is the output:

find: ‘/run/user/1001/gvfs’: Permission denied

Home manager shows up despite not being in use anymore. Have I somehow not uninstalled it correctly? Everything else gets removed correctly when I remove it from the configuration and rebuild, but for some reason Alacritty refuses to be uninstalled.

I resolved this by installing Home-Manager and building a configuration with home-manager imported, but with no settings. So:

  • home-manager channel added and updated
  • home-manager imported in configuration.nix
  • rebuild with no home-manager settings in configuration.nix
  • voila!

Will leave this in case somebody else might find it useful. Feel free to remove if you see it fit.

You need to collect garbage in the mix store for things to fill vanish.

I’d not suggest to use nix-collect-garbage -d unless you know that older generations will not work anyway, and you also know that the currently active generation is bootable!

You should prefer nix-collect-garbage --delete-older-than= with a timespan, to make sure that you always have a way back.

It might have been easier to just use nix-env -e home-manager-path to just remove HM from your users environment.

Sadly the “uninstall” story of HM is quite poor, and I think, it is also something no one actually cared about.

1 Like