Tweag + Nix dev update #25

More than a month after the previous update (and I don’t even have a newborn as an excuse this time), here are some news from the Tweag Nix team.

Because this is a long period and a lot of stuff has been happening, I will only focus on the highlights so that this doesn’t read too much like a boring changelog.

Nix 2.6 released

First things first, @edolstra released Nix 2.6.0 (and the 2.6.1). While the release itself isn’treally a huge amount of work (essentially running a script to upload everything where it should be), it always marks the achievement of a substantial amount of work by the community as a whole. So it is an important milestone. The highlights of the release are described in the announcement post or the explanatory video:

This release nearly got postponed because of a silly bug that caused some very strange evaluation errors, but that @edolstra fixed right on time (also accidentally leading to the dual bug, but that was fortunately much less annoying − and was easy to fix).

Nix CI

  • @thufschmitt worked on improving the CI, both in terms of speed (the typical CI run for a pull-request could easily take a full hour, and frequently timeout) and reliability (more than half of the CI jobs used to fail because of some flaky darwin tests). Thanks in particular to nix#6179, the CI times are now below 40mins (which is still way too much, but already better, and there’s hopefully more to come). And nix#6187 should hopefully make the CI results a bit more relevant, waiting for a proper fix of the underlying issue.
  • @edolstra added a new hydra test using a fixed nixpkgs for a regression test, as well as for tracking the performances of Nix on a substantial (and quite representative) expression. The benchmark results are plotted at https://hydra.nixos.org/job/nix/master/metrics.nixpkgs#tabs-charts

Flakes

  • I mentioned last time that @edolstra was working on removing the need to copy the flake contents to the store before evaluating them. This is still ongoing. No PR yet, but everything is accessible in its own branch. Major new features are the ability to apply patches to trees, and to use zip files (such as GitHub flakes) without having to unpack them.
  • @edolstra changed the default paths in flakes from defaultBlah to blah.default (nix@162fbe).

NixOS webpage

As part of the marketing team, @garbas has been doing some great work on the homepage, both on the actual content (https://github.com/NixOS/nixos-homepage/pull/805) and on the infrastructure (https://github.com/NixOS/nixos-homepage/pull/798).

In addition, he also helped to launch the community survey.

NixOS module system

Being currently free of any client engagement, @infinisil is back on course and has been busy improving the module system in a number of small ways (nixpkgs#162283, nixpkgs#162271, nixpkgs#160491, nixpkgs#160489, nixpkgs#160487)

Nickel

You may think that not much has been going on the Nickel side, since this section has been small or absent from the recent updates. Actually, that’s quite the contrary, and this lack of reporting is just incidental to the Nickel team now having its own separate meetings. We actually have some very exciting things coming very soon. In the meantime, here is what we worked on.

  • We’ve done a lot of pending changes to the syntax, breaking pretty much everything now, so we don’t have to do it later.
    • @mboes switched the case convention to one like Rust: snake_case for values, UpperCamelCase for types and contracts #518
    • @yannham changed list to array (#622, both the type and the stdlib module) to reflect the actual characteristics of the data structure (lists/arrays are implemented as vector internally).
    • @yannham implemented an unified syntax for types and terms (#589, #609, #612). No more # and strange variations like list/List: foo | #(GreaterThan 2) -> #(Nullable num) is now the natural foo | GreaterThan 2 -> Nullable Num (yes, List is now Array). See the corresponding RFC for more details.
    • @francois-caddet got rid of // for comment, and use # instead, more in line with Nix and configuration languages in general (#634)
    • @francois-caddet also changed string interpolation to use % instead of # (#624). We needed that to use # for comments. We didn’t want to do as Nix and pick $ which conflicts a lot with embedding shell scripts, so we chose %, that is both existing but hopefully not too common either for interpolation.
  • @yannham got rid of embarassingly large memory leaks caused by the use of reference counting and recursive records (#631).
  • A lot of work on the documentation front, to build a basic user-manual. The manual is being integrated right now on the website.
    • @acaccia wrote a chapter on the syntax
    • @yannham wrote chapters on typing, contracts and correctness in general
    • @francoiscaddet wrote a chapter on merging

And that’s all, folks

12 Likes