Here at Determinate Systems, we’re ringing in the new year with some quality-of-life enhancements for our users.
Determinate Nix 3.15.1 is here with smarter fetchTree behavior as well as a new builtins.filterAttrs function.
fetchTree improvement
builtins.fetchTree now implicitly treats the fetched tree as “final” when a narHash is supplied, meaning that it doesn’t return attributes like lastModified or revCount unless they were specified by the caller.
This makes it possible to substitute the tree from a binary cache, which is often more efficient.
Furthermore, for Git inputs, it enables Nix to perform a shallow fetch, which is much faster.
This is primarily useful for users of flake-compat, since it uses builtins.fetchTree internally.
Relevant pull request
New builtins.filterAttrs function
Filtering attributes in an attribute set is a common operation in Nix expressions.
Traditionally, Nix devs have relied on the lib.filterAttrs function in Nixpkgs for this, but we’ve opted to incorporate it into Determinate Nix as a built-in function due to its ubiquity.
The function is now much faster and no longer requires the bulky Nixpkgs dependency.
Here’s an example:
nix-repl> builtins.filterAttrs (n: v: v == "yes") { a = "no"; b = "yes"; }{ b = "yes"; }A more behind-the-scenes advantage of bringing this into Determinate Nix is that Determinate Secure Packages is now patched to use builtins.filterAttrs instead of lib.filterAttrs, which should speed up evaluation in many cases.
Relevant pull request
How to get Determinate Nix
If you already have Determinate Nix installed, you can upgrade to 3.15.1 with one Determinate Nixd command:
sudo determinate-nixd upgradeIf you don’t yet have Determinate Nix installed, you can upgrade or migrate to Determinate Nix on macOS using our graphical installer:
Install Determinate Nix on macOS now 🍎
With support for Apple Silicon (aarch64-darwin)
On Linux:
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \ sh -s -- install --determinateOn NixOS, we recommend using our dedicated NixOS module or our NixOS ISO (NixOS installer for x86_64, NixOS installer for ARM) with Determinate Nix pre-installed.
On GitHub Actions:
on: pull_request: workflow_dispatch: push: branches: - main
jobs: nix-ci: runs-on: ubuntu-latest # Include this block to log in to FlakeHub and access private flakes permissions: id-token: write contents: read steps: - uses: actions/checkout@v5 - uses: DeterminateSystems/flake-checker-action@main - uses: DeterminateSystems/determinate-nix-action@v3 - uses: DeterminateSystems/flakehub-cache-action@main - run: nix flake checkIn Amazon Web Services:
data "aws_ami" "detsys_nixos" { most_recent = true owners = ["535002876703"]
filter { name = "name" values = ["determinate/nixos/epoch-1/*"] }
filter { name = "architecture" values = ["x86_64"] }}