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

nix-env selecting old channels in ~/.nix-defexpr #1067

Open
Gabriella439 opened this issue Sep 20, 2016 · 5 comments
Open

nix-env selecting old channels in ~/.nix-defexpr #1067

Gabriella439 opened this issue Sep 20, 2016 · 5 comments
Assignees
Labels

Comments

@Gabriella439
Copy link
Contributor

I have a colleague who had the following issue on OS X:

They ran roughly the following sequence of commands:

$ nix-channel --add https://nixos.org/channels/nixos-16.09/ nixos-16.09
$ nix-channel --update
$ nix-channel --remove nixos-16.09
$ nix-channel --add https://nixos.org/channels/nixos-16.03/ nixpkgs
$ nix-channel --update

... which left them with a ~/.nix-defexpr/channels directory that looks like this:

$ ls ~/.nix-defexpr/channels/
binary-caches/
manifest.nix
nixos-16.09/
nixpkgs/

... where the nixos-16.09 directory is still left behind after --removeing the channel and --update.

Whenever they run nix-env to install something, nix-env uses ~/.nix-defexpr/nixos-16.09 as the path for the base set of expressions instead of nixpkgs like my colleague intended.

The documentation from nix-env says that nix-env uses the contents of ~/.nix-defexpr as the default path, but:

  • (A) It does not explain how it selects between multiple channels if there is more than one channel still present in ~/.nix-defexpr/channels
  • (B) This seems like confusing behavior. Why doesn't nix-env use the NIX_PATH environment variable (which was correctly configured in my colleague's case)?
@danbst
Copy link
Contributor

danbst commented Sep 21, 2016

you may be interested in #993

@CMCDragonkai
Copy link
Member

CMCDragonkai commented Oct 25, 2017

I have experienced this as well. This makes the expectation that nix-env using fail when you don't realise that a rogue channel is left in the channels directory.

clever helped me on the IRC channel to remove my rogue channel: nix-env -p /nix/var/nix/profiles/per-user/cmcdragonkai/channels -e /nix/store/qf450s7ayjaijqlaqmf6m2wp053ifvas-nixos-17.03-17.03beta320.ade5837. That force removes the nixos-17.03 channel, and now my nix-env respects <nixpkgs> again!

@stale
Copy link

stale bot commented Feb 15, 2021

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

@nh2
Copy link
Contributor

nh2 commented Dec 2, 2021

The documentation from nix-env says that nix-env uses the contents of ~/.nix-defexpr as the default path, but:

* (A) It does not explain how it selects between multiple channels if there is more than one channel still present in `~/.nix-defexpr/channels`

I have extracted this in a separate documentation issue at: #5710

@stale stale bot removed the stale label Dec 2, 2021
@stale
Copy link

stale bot commented Jul 11, 2022

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

@stale stale bot added the stale label Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants