I've been using Nix Home Manager to manage packages on Mac OS, and hit a new problem adding ripgrep to home.packages - this has previously been fine. I don't really know what the error means or how to correctly fix it - help appreciated!

$ home-manager switch
Starting Home Manager activation
Activating checkFilesChanged
Activating checkLaunchAgents
Activating checkLinkTargets
Activating writeBoundary
Activating copyFonts
Activating installPackages
error: files '/nix/store/qdylbr09f0zjc44zkxjrf4ilzkpj05gl-home-manager-path/bin/man' and '/nix/store/2jahwbgdzz4cabfp0w1009ysdpb47ycb-home-manager-path/bin/man' have the same priority 5; use 'nix-env --set-flag priority NUMBER INSTALLED_PKGNAME' or type 'nix profile install --help' if using 'nix profile' to find out howto change the priority of one of the conflicting packages (0 being the highest priority)

Oops, Nix failed to install your new Home Manager profile!

Perhaps there is a conflict with a package that was installed using
"nix profile install"? Try running

    nix profile list

and if there is a conflicting package you can remove it with

    nix profile remove {number | store path}

Then try activating your Home Manager configuration again.


$ nix profile list
0 - - /nix/store/2jahwbgdzz4cabfp0w1009ysdpb47ycb-home-manager-path
1 github:nix-community/comma#packages.aarch64-darwin.default github:nix-community/comma/691120d169189f3a9cb29b1c72bcd521ac372b2b#packages.aarch64-darwin.default /nix/store/la30szfb9m9bq7y8nwc2dmxjlq361rqm-comma-1.2.3
2 - - /nix/store/2jahwbgdzz4cabfp0w1009ysdpb47ycb-home-manager-path

I have recently installed comma, which sounds like it could plausibly be part of the issue?

  • This kind of error is typically fired when two packages are trying to install stuff at the same location (here man pages from home-manager as I understand): nix does not know which file/package to choose. Here it seems like the package is home-manager so it seems that you installed twice home manager somehow (maybe once with flake, once without?). And indeed you get two home-manager in your profile. Maybe try to remove them with nix profile remove 0 and nix profile remove 2 and start again.
    – tobiasBora
    Oct 27, 2022 at 7:25
  • It looks like this bug - github.com/nix-community/home-manager/issues/2848. Each "home-manager switch" creates a new profile - if I delete the duplicate, it doesn't fix it.
    – Matt R
    Oct 31, 2022 at 18:38

1 Answer 1


I haven't got a fix, but a workaround that works for me is the following recipe, needed after every home-manager switch:

nix profile list

# Check numbers, but you need to remove both home-manager profiles:
nix profile remove 0
nix profile remove 0

# Reinstall home manager - I needed a NIX_PATH workaround from https://github.com/nix-community/home-manager/issues/2564#issuecomment-994943471:
export NIX_PATH=${NIX_PATH:+$NIX_PATH:}$HOME/.nix-defexpr/channels:/nix/var/nix/profiles/per-user/root/channels
nix-shell '<home-manager>' -A install

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .