nix-community / home-manager

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

bug: path is a symlink error #5402

Open jennydaman opened 2 weeks ago

jennydaman commented 2 weeks ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

Hello, I have a very esoteric setup (on a legacy shared system). These are Linux servers where:

My home-manager flake.nix can be found here:

https://gitlab.com/jennydaman/hm-jia/-/blob/62162cec91ebd6f77b089988677e99c5b3848ab4/flake.nix

I typically want to run home-manager switch like this:

home-manager switch --impure --flake /neuro/labs/grantlab/users/jennings.zhang/.config/home-manager#restricted

In rare circumstances, this works, but I can't discern why. Usually, I get an error instead:

error:
       … while fetching the input 'git+file:///neuro/labs/grantlab/users/jennings.zhang/.config/home-manager'

       error: path '/neuro/labs/grantlab/users/jennings.zhang/.config/home-manager/neuro/labs/grantlab' is a symlink

These other permutations cause the same error:

home-manager switch --impure --flake /neuro/users/jennings.zhang/.config/home-manager#restricted
env HOME=/neuro/labs/grantlab/users/jennings.zhang home-manager switch --impure --flake /neuro/labs/grantlab/users/jennings.zhang/.config/home-manager#restricted

However, the command below works 100% of the time:

cd ~/.config/home-manager
home-manager switch --impure --flake .#restricted

Maintainer CC

No response

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.0.12-76060006-generic, Ubuntu, 22.04.3 LTS (Jammy Jellyfish), nobuild`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.20.6`
 - nixpkgs: `/net/redacted.server.server.server/Data/Shares/LabName/neuro/labs/grantlab/users/jennings.zhang/.nix-portable/channels/nixpkgs`