Tweag + Nix dev update #29

Hello Nixers :wave:

Some news from the Tweag Nix team. Lots of nice things happening these days, so I had to trim things down a bit to focus on the most important bits:

Like usual, the previous update is available here.

Nix implementation

  • The new nix profile command had a limitation compared to the old nix-env one: If a derivation has the outputsToInstall field set to a list of strings, then nix-env would by default install all of these (rather than just the default one), but nix profile didn’t take that into account. @edolstra opened a PR fixing this (nix#6426), and also adding the same behavior to the other nix commands for consistency. This raised the issue of being able to explicitely select an output (which this PR removed), so @edolstra opened a follow-up to add a new syntax restoring this ability (nix#6449)
  • One of the improvements enabled by the flake model is an evaluation cache, making the new nix command potentially much faster. nix eval doesn’t benefit from this cache, because the cache is only partial and wouldn’t work well with the fact that nix eval eventually forces the value. It therefore had used a different code path than the other nix commands, which resulted in slightly different behavior. @edolstra fixed this by making it use the same code path as the rest − although it still isn’t able to meaningfully use the evaluation cache (nix#6404)
  • @pennae (not from Tweag) opened a pull-request some time ago to make the internal representation of the code location of Nix values and symbols more compact, which in turn made the representation of the attribute set members smaller, leading to a reduction of memory consumption and performance improvement of around 10-15% for each. This pull request was however rather big and touched some sensible parts of the code, so it was still waiting for a proper review. Layus eventually started the review effort, then joined by @thufschmitt, and after a bit of discussion it got merged (nix#6218). @edolstra also asked for a follow-up to fix an inconsistency that it had introduced (nix#6438).

Communication

Nixos website infrastructure

Content-addressed derivations

  • During one of our standups, ConnorBaker brought attention on the fact that content-addressed derivations were broken on the M1 macs (nix#6065). After some investigations, @thufschmitt went to the root cause (the hash rewriting breaking the mandatory signatures), and offerred a possible stop-gap solution

Misc

  • Infinisil worked on npmlock2nix, trying to make it possible for it to access private repositories (npmlock2nix#160)
  • @edolstra released a new nix version (2.8.0). The great news being that these releases are getting so predictable and boring that they don’t deserve to make the headline of these updates anymore.
  • @fricklerhandwerk in collaboration with community members made a considerable effort towards building a consistent in-depth documentation of how Nix works. Most of the current outcome is visible here.

Nickel

The nickel team has been incredibly busy these days, both improving the language and building tooling around it to make it a great tool to work with:

  • @ErinvanderVeen added recursive lets (#681)
  • @ErinvandeerVeen has been working on a code formatter. The first step was to write a tree-sitter grammar for Nickel, which provides highlighing for a multitude of code editors. He is now working on the formatter itself.
  • @francois-caddet fixed the method for running benchmarks, going from severe memory leaks that made most of them eating all the RAM, to using a reasonable and constant amount of memory (#673)
  • @francois-caddet wrote a pretty printer for the AST (#683). It is intended for debugging and printing composite contracts in errors, but also to serve as a base for the code formatter.
  • @yannham continued working on a specification of the type system (#691).
  • @thufschmitt started working on a POC fork of Nickel that would be able to communicate with the Nix store (https://github.com/thufschmitt/nickel/commits/nix-builtins). This is by far just an experiment, but could be a nice way for testing the flexibility of the language with real-world examples.

And that’s all, folks.

20 Likes
Hosted by Flying Circus.