NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.08k stars 14.13k forks source link

warning: name collision in input Nix expressions, skipping ~/.nix-defexpr/channels_root/nixpkgs' #44721

Closed ghost closed 2 years ago

ghost commented 6 years ago
> nix-env -u
warning: name collision in input Nix expressions, skipping ~/.nix-defexpr/channels_root/nixpkgs'

I added a wrong channel name using nix-channel --add xyz and then deleted it and now nix seems to be broken when I try to upgrade.

The thing I wanted to do is add unstable channel. I used nix-channel --add https://nixos.org/channels/nixpkgs-unstable after I discovered the correct channel name and now my ~/.nix-channels only contains this one URL. The nix Manuel states (Subscribing really just means that the URL is added to the file ~/.nix-channels, where it is read by subsequent calls to nix-channel --update.) You can “unsubscribe” using nix-channel --remove: so there seems to be some hidden magic that now broke nix ??!

> cat .nix-channels 
https://nixos.org/channels/nixpkgs-unstable nixpkgs

further: I found it very strange that nix created dozens of users on install without asking me for any confirmation and I still have next to no idea what they do.

Please run nix-shell -p nix-info --run "nix-info -m" and paste the results.

nix-shell -p nix-info --run "nix-info -m"

 - system: `"x86_64-darwin"`
 - host os: `Darwin 17.7.0, macOS 10.13.6`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.0.4`
 - channels: `"nixpkgs"`
 - channels(root): `"nixpkgs-18.09pre147700.03e47c388ac"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

thanks for help/ explanation I like the concept of nix !

ghost commented 6 years ago

so I deleted .nix-defexpr and ran nix-env --update and got the folder back and I can now run nix-env -u but still do not get the most recent versions e.g. still clang 5 and not 7. Do the unstable packages have a certain prefix or anything?

the docs say https://nixos.org/nixpkgs/download.html

After this, you can use nix-env to install available packages.

ikervagyok commented 6 years ago

i'm no expert on nix without nixos, but you may find these useful:

  1. hydra, where you can find the latest builds
  2. nixpkgs, where you can see that there is no clang 7 in nixpkgs atm. feel free to add it.
  3. you seem to be on unstable already, as your channel's version isnixpkgs-18.09-pre
  4. the users are probably nixbldXXX, which are the nix build users. they are just used for isolated, non-root builds.
ghost commented 6 years ago

thanks for your quick response !

yeah I made my way somehow over to this job queue https://hydra.nixos.org/jobset/nixos/trunk-combined#tabs-jobs and saw that at least clang 6 should be available.

nixbldXXX

yes thats what they are but before creating a dozen users it would be nice to ask for permission.

Also, it first seemed as if all the installer would do is create /nix but in the end it created all those users, created a whole bunch of dotfiles and dotdirectories, which in order to understand what they do probably require to understand the whole nix stack and furthermore the installer just said "hey run this nix-env bla command" which then in turn downloaded a gigabyte of packages without any notice/ warning/ question.

not a very nice experience to start from but maybe this can somehow be made into a working installation. I'm at least to somewhat hostile grammar from homebrew (bottle keg etc) but did not expect the same learning curve here.

Is there an easy explanation what all those nix folders/ files in my home dir do? I get there is .nix_profile for the symlinks for my current set of installed packages and probably some config file to specify my current package setup but other than that....

another technical question that was not answered in the docs was how nix-shell works in regards to package installation. In the example it was shown how you can do nix-shell foo to install foo, but what if I'm already In such a shell and want to install an additional package bar? nix-env was not available but I'm sure there is/ should be a way to install another package into such a tmp shell?

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

abathur commented 2 years ago

Closing. User deleted and seems like a Nix issue if it still exists.