Home-manager: path collision during upgrade


While running home-manager switch I get the following error at the end:

building '/nix/store/zlflbakm1wriby57vj0vwxn5in26xdyg-emacs-with-packages-28.2.drv'...
building '/nix/store/fx5b0x2vcc1hs4bxdj46rx7ld0pk5gl4-xplugrc.drv'...
building '/nix/store/q8sbxqjvhkqkc800v396rx1m3clap0i2-emacs.service.drv'...
building '/nix/store/dyjf90n94zj6bqdav7vg897f3qj7h1by-home-manager-path.drv'...
error: collision between `/nix/store/h29rxipmgnk10p9hx92ndkmfrh26p9b5-python3-3.11.4/bin/idle3' and `/nix/store/wlxpsdzfvdanfzh704qmgyzb42qvy4fr-python3-3.10.12/bin/idle3'
error: builder for '/nix/store/dyjf90n94zj6bqdav7vg897f3qj7h1by-home-manager-path.drv' failed with exit code 25
error: 1 dependencies of derivation '/nix/store/vd5p4vzrw4s18jpf8b2wfxwzq4wx3zpb-home-manager-generation.drv' failed to build

I am aware that this can happen is I manually install something with nix-env, and then try to install it with home-manager, as explained in the home-manager FAQ. However this time it is not the case:

❯ nix-env -q
❯ nix-env --list-generations
   9   2023-08-01 07:12:24   (current)

How can I remove the conflicting path?

You have two versions of python in your path defined in your home-manager config, 3.10 and 3.11. You either need to remove one of them or change meta.priority with overrideAttrs to prefer one of the two.

1 Like

Thanks, I was indeed installing python 3.11 explicitly, and removing it allowed me to upgrade. However I have no idea what pulls python 3.10 in. Is there a way to know what derivation brings /nix/store/wlxpsdzfvdanfzh704qmgyzb42qvy4fr-python3-3.10.12/bin/idle3 ?

If you haven’t pulled in python3 explicitly in home.packages, this is probably a bug in some package definition since the python interpreter probably doesn’t need to be exposed in the path.

You might have some luck using nix why-depends ~/.nix-profile /nix/store/wlxpsdzfvdanfzh704qmgyzb42qvy4fr-python3-3.10.12 to find out if another store path is pulling it in.