Nix 2.10.0 released

Hi,

I’m pleased to announce the availability of Nix 2.10.0. It will be available from NixOS - Getting Nix / NixOS and http://releases.nixos.org/?prefix=nix/nix-2.10.0/.

Here are the release notes:

  • nix repl now takes installables on the command line, unifying the usage with other commands that use --file and --expr. Primary breaking change is for the common usage of nix repl '<nixpkgs>' which can be recovered with nix repl --file '<nixpkgs>' or nix repl --expr 'import <nixpkgs>{}'.

    This is currently guarded by the repl-flake experimental feature.

  • A new function builtins.traceVerbose is available. It is similar to builtins.trace if the trace-verbose setting is set to true, and it is a no-op otherwise.

  • nix search has a new flag --exclude to filter out packages.

  • On Linux, if /nix doesn’t exist and cannot be created and you’re not running as root, Nix will automatically use ~/.local/share/nix/root as a chroot store. This enables non-root users to download the statically linked Nix binary and have it work out of the box, e.g.

    # ~/nix run nixpkgs#hello
    warning: '/nix' does not exists, so Nix will use '/home/ubuntu/.local/share/nix/root' as a chroot store
    Hello, world!
    
  • flake-registry.json is now fetched from channels.nixos.org.

  • Nix can now be built with LTO by passing --enable-lto to configure. LTO is currently only supported when building with GCC.

29 Likes

Maybe you meant to name this builtins.traceIfVerbose?

4 Likes

https://github.com/NixOS/nix/issues/6790 is making me think that something (the no-root-nix code?) is causing trouble during single-user installs.

Is there a way to upgrade to 2.10.0. I’ve tried Upgrading Nix, but I’m stuck on 2.9.1.

Those upgrade instructions don’t do anything until nixpkgs is updated. Currently it’s still on 2.9.1.

In the meantime, if you’re on x86_64-linux, you can do

# nix-env -i /nix/store/5kdlfa4clss463zpf6wr6wnva1fczpfz-nix-2.10.1

and on x86_64-darwin:

# nix-env -i /nix/store/xs2priyrwwv92296n1x1dgav4h3si6ki-nix-2.10.1

Or if you’re using flakes and the new nix profile command:

# nix profile install nix/2.10.1
3 Likes

Those look suspiciously wrong for something with a version of 2.10.1 :wink:

1 Like

Oops, yes. I’ve fixed them!

2 Likes

Note that the “auto-chroot-store” stuff also appears to break the building of lazy-options.json on nixpkgs-unstable.

I made a script to automate the upgrade — https://github.com/steshaw/shelly/blob/0382ea43feb008c618fa25e045cfe59b64112708/scripts/nix-upgrade. Tested on macOS and Linux+Nix multi-user.

https://hydra.nixos.org/eval/1771620#tabs-now-fail

amazonImage, proxmoxImage and ova are broken. Bisecting led me to the commit bumping nix stable to 2.10

the build logs don’t give much information

[illustris@desktop:~/src/nixpkgs]$ nix log /nix/store/lcgcqarfkmpc85gw5h4mpss9kxyi7mqy-nixos-ova-22.11pre56789.gfedcba-x86_64-linux.drv
warning: '/nix' does not exist, so Nix will use '/build/.local/share/nix/root' as a chroot store
running nixos-install...
copying channel...
error: build of '/nix/store/csn2jpg8c9iv5xx892n4j51in82d47jy-nixos-22.11pre56789.gfedcba' failed

/build/.local/share/nix/root/nix/store/ only has an empty .links folder.

The first breaking commit of nix is Automatically use a chroot store if /nix doesn't exist · NixOS/nix@2a9fddc · GitHub

EDIT: seems to be fixed in 2.10.3

1 Like
Hosted by Flying Circus.