Hacker News new | ask | show | jobs
by eridius 3041 days ago
How do I upgrade my existing Nix installation? After updating the nixpkgs-unstable channel, nixpkgs.nix is still 1.11.16 (and nixpkgs.nixUnstable is a 2.0 pre-release).
3 comments

Look up channels status here:

http://howoldis.herokuapp.com

It will prob take like 5 hours to be updated. Run nix-channel --update then reinstall nix.

Would it be safe to run `curl https://nixos.org/nix/install | sh` (safe as in it won't screw with my existing installed packages), and if so, will that get me Nix 2.0? Or do I still have to wait for nixpkgs-unstable to rebuild?
The easiest way is probably to do following:

  git clone https://github.com/nixos/nixpkgs
  cd nixpkgs
  git checkout origin/nix-2.0
  nix-env -i $(nix-build --no-out-link . -A nix)
If you already have Nix installed, what you want to do is change the channel, and do an upgrade.
Change the channel to what? It's already on nixpkgs-unstable.
nix.package = pkgs.nixUnstable;
nixpkgs-unstable was updated 4 hours ago. Still doesn't have Nix 2.0.

This strikes me as very strange. Why was Nix 2.0 released without updating nixpkgs?

It looks like Nix 2.0 is tagged[1] but nixpkgs isn't updated yet[2]

[1] https://github.com/NixOS/nix/releases/tag/2.0

[2] https://github.com/NixOS/nixpkgs/blob/472dd33ea4905d562d9380...

You can upgrade right now with `nix.package = pkgs.nixUnstable;` in your `~/.nixpkgs/config.nix` [1] or on the command-line: `nix-channel --add https://nixos.org/channels/nixos-unstable nixos` followed by `nix-channel --update` if on any system but NixOS or `nixos-rebuild switch` if on NixOS.

[1] https://ebzzry.io/en/nix/#nixpkgsconfiguration

As I mentioned in my comment, nixpkgs.nixUnstable shows up as a 2.0 pre-release (specifically, nix-2.0pre5968_a6c0b773).