nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.04k stars 1.82k forks source link

bug: home manager fails to install in the official nix docker container #4555

Open darthdeus opened 1 year ago

darthdeus commented 1 year ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

Installing home manager in a clean official nix docker container fails with a conflict. Full Dockerfile

FROM nixos/nix

RUN nix-channel --add https://github.com/nix-community/home-manag
    && nix-channel --update

RUN nix-shell '<home-manager>' -A install

Fails with

/nix/store/8gm6l0hvyfg1vhhzr67zkv1ipjj7cqmz-home-manager-generation
Starting Home Manager activation
Activating checkFilesChanged
Activating checkLinkTargets
Activating writeBoundary
Activating installPackages
installing 'home-manager-path'
building '/nix/store/6zfy37i1frfgjw6vcn0rrkj8pkq5127i-user-environment.drv'...
error: Unable to build profile. There is a conflict for the following files:

         /nix/store/7vj5s0nmbkq7qcw3q5397zwg5c12a669-home-manager-path/bin/mandb
         /nix/store/vr04ag53qddlr77886lq9mmssibbaz18-man-db-2.11.2/bin/mandb
error: builder for '/nix/store/6zfy37i1frfgjw6vcn0rrkj8pkq5127i-user-environment.drv' failed with exit code 1

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

Perhaps there is a conflict with a package that was installed using
"nix-env -i"? Try running

    nix-env -q

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

    nix-env -e {package name}

Then try activating your Home Manager configuration again.
Uh oh, the installation failed! Please create an issue at

    https://github.com/nix-community/home-manager/issues

if the error seems to be the fault of Home Manager.
The command '/bin/sh -c nix-shell '<home-manager>' -A install' returned a non-zero code: 1

I checked and the nix channel is unstable as should be matching home manager

bash-5.2# nix-channel --list
home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
nixpkgs https://nixos.org/channels/nixpkgs-unstable

All that needs to be done to reproduce is just create a Dockerfile with the above content and run docker build -t foo .

Maintainer CC

No response

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.1.55-1-lts`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"home-manager, nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
dawidd6 commented 11 months ago

Related: https://github.com/nix-community/home-manager/issues/2995

https://github.com/nix-community/home-manager/pull/4421 might fix this

stale[bot] commented 8 months ago

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

If you are not the original author of the issue

* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.

Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.