Nix 2.14.0 released

Hi,

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

Here are the release notes:

  • A new function builtins.readFileType is available. It is similar to builtins.readDir but acts on a single file or directory.

  • In flakes, the .outPath attribute of a flake now always refers to the directory containing the flake.nix. This was not the case for when flake.nix was in a subdirectory of e.g. a Git repository. The root of the source of a flake in a subdirectory is still available in .sourceInfo.outPath.

  • In derivations that use structured attributes, you can now use unsafeDiscardReferences to disable scanning a given output for runtime dependencies:

    __structuredAttrs = true;
    unsafeDiscardReferences.out = true;
    

    This is useful e.g. when generating self-contained filesystem images with their own embedded Nix store: hashes found inside such an image refer to the embedded store and not to the host’s Nix store.

    This requires the discard-references experimental feature.

18 Likes

More changes that I think people might care for:

13 Likes

@Kranzes would you please open a PR to update the release notes? Not everyone using Nix reads Discourse.

3 Likes

Hey Eelco,

This release broke install-nix-action: Installer broken by Nix 2.14 · Issue #161 · cachix/install-nix-action · GitHub

I applaud more regular releases! Would it be possible to do a release candidate a few days before making an official release?

That way we can catch unfortunate regressions like this that break many setups.

9 Likes

Good point, please open an issue or ideally a PR to the maintainer’s manual so we can put it on the team’s agenda.

1 Like

Yes, that’s extremely annoying bug breaking so many CIs. Is anybody working on quick fix ?

Just found it, cachix/install-nix-action@v20 should fix the issue. Thanks heaps @domenkozar .

Well, the master branch is our release candidate (i.e. it’s supposed to be in a releasable state). Maybe it’s possible to set up some continuous testing of install-nix-action against nix-master?

Alternatively, we could delay updating https://nixos.org/nix/install for a few days after release to give people a time to test the new version.

It’s a good idea to pin a specific version of Nix in CI scripts to avoid this kind of breakage, e.g. fetch https://releases.nixos.org/nix/nix-2.12.1/install rather than https://nixos.org/nix/install.

13 Likes

I’ve uploaded 2.14.1 which should fix the problem with the profile script.

3 Likes

While this issue could be caught with automated testing, but not all kinds of testing can be automated.

If you think release candidates wouldn’t help making Nix releases more resilient to regressions, then maybe we could have release dates preannounced a few days before the official release?

2 Likes

The date of the next release can be seen in the milestone on Github. It used to be on the NixOS calendar, but it got lost at some point.

4 Likes

With the update to flakes .outPath for flakes in a subdirectory of a git repository, will the entire git repository still be added to the store on nix build, or just the subdirectory containing the flake?

This release seems to cause flakes to evaluate eagerly, as in for example you can not run an app from a flake if packages does not evaluate despite it not being needed to run the app.

Can you create an issue for that, ideally with a reproducer? I’m not aware of changes in how flakes are evaluated in 2.14.

Yes, it will still add the the entire repo to the store.

Hosted by Flying Circus.