Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: path '/nix/var/nix/profiles/per-user/root/channels' is a symlink #262

Open
samuelmarquis opened this issue Dec 20, 2024 · 3 comments

Comments

@samuelmarquis
Copy link

New to NixOS, fresh (modulo some fiddling to get sway working) install. I tried adding nix-index as a package, but when I run the nix-index command I get this (after a few minutes on querying packages):

+ querying available packages
error: querying available packages failed
caused by: nix-env failed with error: nix-env failed with exit status: 1:
error:
       … while querying the derivation named 'nixpkgs-manual'

       … while calling the 'getAttr' builtin
         at <nix/derivation-internal.nix>:44:19:
           43|       value = commonAttrs // {
           44|         outPath = builtins.getAttr outputName strict;
             |                   ^
           45|         drvPath = strict.drvPath;

       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: path '/nix/var/nix/profiles/per-user/root/channels' is a symlink

Switched from adding as a package to using programs.nix-index.enable = true, but the issue persists.

Google turned up absolutely nothing, so I'm not sure what to make of this.

Here's the output with --show-trace:

error:
       … while querying the derivation named 'nixpkgs-manual'

       … while calling the 'getAttr' builtin
         at <nix/derivation-internal.nix>:44:19:
           43|       value = commonAttrs // {
           44|         outPath = builtins.getAttr outputName strict;
             |                   ^
           45|         drvPath = strict.drvPath;

       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|

       … while evaluating derivation 'nixpkgs-manual'
         whose name attribute is located at /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/stdenv/generic/make-derivation.nix:1:12605

       … while evaluating attribute 'buildPhase' of derivation 'nixpkgs-manual'
         at /nix/var/nix/profiles/per-user/root/channels/nixos/doc/doc-support/package.nix:1:987:
       … while calling the 'getAttr' builtin
         at <nix/derivation-internal.nix>:44:19:
           43|       value = commonAttrs // {
           44|         outPath = builtins.getAttr outputName strict;
             |                   ^
           45|         drvPath = strict.drvPath;

       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|

       … while evaluating derivation 'nixpkgs-lib-docs'
         whose name attribute is located at /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/stdenv/generic/make-derivation.nix:1:12605

       … while evaluating attribute 'src' of derivation 'nixpkgs-lib-docs'
         at /nix/var/nix/profiles/per-user/root/channels/nixos/doc/doc-support/lib-function-docs.nix:1:2062:
       … from call site
         at /nix/var/nix/profiles/per-user/root/channels/nixos/doc/doc-support/lib-function-docs.nix:1:2068:
       … while calling 'toSource'
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/fileset/default.nix:1:11946:
       … while evaluating a branch condition
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/fileset/default.nix:1:13320:
       … in the left operand of the AND (&&) operator
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/fileset/default.nix:1:13360:
       … in the argument of the not operator
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/fileset/default.nix:1:13324:
       … from call site
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/fileset/default.nix:1:12160:
       … while calling '_coerce'
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/fileset/internal.nix:1:4147:
       … from call site
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/fileset/internal.nix:1:6089:
       … while calling '_singleton'
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/fileset/internal.nix:1:7685:
       … while evaluating a branch condition
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/fileset/internal.nix:1:7738:
       … while calling the 'readFileType' builtin
         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/fileset/internal.nix:1:7712:
       error: path '/nix/var/nix/profiles/per-user/root/channels' is a symlink

To be clear though: I'm not sure if this is a rtfm moment. I'm following instructions from a disparate batch of sources trying to figure out how to get a library so that I can build something, nix-index was recommended, now I'm here and somewhat baffled. Maybe I shouldn't be here? But I'm confused either way. Here's my configuration.nix, let me know if I'm doing anything stupid

@samuelmarquis
Copy link
Author

Although I'm not certain, this seemed to fix the issue? Leaving it open in case anyone else runs into a stranger variant, or if it re-emerges.

@sigmonsays
Copy link

This is still an issue for me on a fresh install using the script. On ubuntu, using multi-user install of nix.

Stuck atm...

@acovaci
Copy link

acovaci commented Jan 23, 2025

Same issue on a fresh install of nix multi-user on MacOS done just now. The suggested fix by @samuelmarquis did not work. It also seems that $NIX_PATH isn't set either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants