Infinite nested nixpkgs folder

I found an infinite nested nixpkgs folder on nixos.
/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixpkgs/nixpkgs/nixpkgs/nixpkgs/nixpkgs/
does someone know why it is there?

1 Like

What does ls -l /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs (no trailing slash!) print?

[root@nixos:/nix]# ls -l /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
lrwxrwxrwx 1 root root 1  1. Jan 1970  /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs -> .

[root@nixos:/nix]# ls -l /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixpkgs
lrwxrwxrwx 1 root root 1  1. Jan 1970  /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixpkgs -> .

[root@nixos:/nix]# ls -l /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixpkgs/nixpkgs/nixpkgs/nixpkgs/nixpkgs
lrwxrwxrwx 1 root root 1  1. Jan 1970  /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixpkgs/nixpkgs/nixpkgs/nixpkgs/nixpkgs -> .

Sounds like you did something strange with your channels. What does sudo nix-channel --list say?

[lukas@nixos:~]$ nix-channel --list

[lukas@nixos:~]$ su
[root@nixos:/nix] nix-channel --list
nixos https://channels.nixos.org/nixos-26.05
nixos-unstable https://channels.nixos.org/nixos-unstable

That looks fine…

Huh. I see it in the channels as well. Looks like it’s not something funny happening on your end then, just something that the channel infrastructure adds to nixpkgs. (Though I have no idea why.)

It’s so that adding /nix/var/nix/profiles/per-user/<user>/nixos to your NIX_PATH also adds <nixpkgs>.

That… seems like a horrible hack. But I don’t have a better theory.

Here’s where the symlink is created

2 Likes