Skip to content

Need easy, guaranteed way to update Nix #1113

@cstrahan

Description

@cstrahan

The Nix package manager should have a command to update the current version of Nix; this would prevent the hoops that I'm currently jumping through:

  1. Try to update an old machine with NixOS installed (from about 12 or 13 months ago), and watch it fail because the installed version of Nix is too old to evaluate the latest Nixpkgs.
  2. Consult https://nixos.org/wiki/How_to_update_when_Nix_is_too_old_to_evaluate_Nixpkgs, which suggests: curl -L https://hydra.nixos.org/job/nixos/trunk-combined/nixpkgs.nix.x86_64-linux/latest-finished/nix/pkg/nix-1.10-x86_64-linux.nixpkg | nix-install-package --non-interactive -
  3. ... which fails because, as Hydra reports, "Path /nix/store/6nkzpsw9wq4gfn84c4d0shjs9hqyw9jy-nix-1.11.4-debug is no longer available."
  4. Click through Hydra and try to find a recent evaluation, hoping that the store path hasn't disappeared.
  5. Find the nixos:trunk-combined:nixpkgs.nix.x86_64-linux job, find the latest evaluation (evaluated on 2016-10-29 18:50:01), and then try to fetch the "One-Click Install" build product.
  6. Get presented with a 404: "Path /nix/store/5q4rqc1fv1vi8z9g6ni0jlf7b802vm67-nix-1.11.4-debug is no longer available."
  7. Realize that I could just nix-store --export $(nix-store -qR $(which nix-build)) > nix.closure from my up-to-date machine, copy that to a USB drive, and then nix-store --import nix.closure on the old machine.
  8. That fails with: "error: imported archive of '/nix/store/....-glibc-2.24' lacks a signature" (despite having nix.requireSignedBinaryCaches = false; configured)
  9. Have no idea what to do about the missing signature.

I still haven't figure out how I'm going to upgrade, but I figure the next step is going to be trying to install from source, and hope that any transitive dependencies don't get me stuck in some sort of catch 22 scenario.

In my case, I've been using Nix/NixOS for a while now and am thoroughly convinced of the benefits (even if things get pretty damned bumpy every now and then), so this isn't going to turn me off. For new users, though, this sort of scenario would very likely be the thing that makes them say "fuck it" and warn their friends.

What we really need is a single command that can get people unstuck in these scenarios.

Metadata

Metadata

Assignees

Labels

new-cliRelating to the "nix" command
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions