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:

/nix/store/8636r3d8rsk7c3l5xcgb1mn37pkfc84k-ncurses-6.3-p20220507/share/terminfo/a/alacritty
/nix/store/ps1fsi8vj8ppahsigvy56dwk0p5f7rqy-home-manager-path/bin/alacritty
/nix/store/chf3wl0gv139m9qxadg1rzq9wm9a1hwj-home-manager-files/.config/alacritty
/nix/store/7ji068smnymqz2lg2fd42hjnjd5czbl6-ncurses-6.3-p20220507/share/terminfo/a/alacritty
/nix/store/bkqhrr3ph5xagx9lv7syp4gr2a474152-alacritty-0.10.1/bin/alacritty
/nix/store/ycar7pp3bxs6s92lwarc6r15gr23m8ai-nixos-22.05/nixos/pkgs/applications/terminal-emulators/alacritty
/nix/store/k72sm42x1ig3lva2461bm4kjj2w70jr1-ncurses-6.3-p20220507/share/terminfo/a/alacritty
/nix/store/v04272x7747kqzkj23w0kccjyngkw14k-alacritty-0.10.1-terminfo/share/terminfo/a/alacritty
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