Home Explore Blog Models CI



nix

2nd chunk of `doc/manual/source/release-notes/rl-2.29.md`
ec616b82deba7a95eae93530221086c6438474f9f0f842b50000000100000dc6
  It does not expose the full locking API, so that the implementation can evolve more freely.
  Locking is controlled with the functions, which cover the common use cases for consuming a flake:
  - `nix_flake_lock_flags_set_mode_check`
  - `nix_flake_lock_flags_set_mode_virtual`
  - `nix_flake_lock_flags_set_mode_write_as_needed`
  - `nix_flake_lock_flags_add_input_override`, which also enables `virtual`

  This change also introduces the new `nix-fetchers-c` library, whose single purpose for now is to manage the (`nix.conf`) settings for the built-in fetchers.

  More details can be found in the [C API documentation](@docroot@/c-api.md).

- No longer copy flakes that are in the nix store [#10435](https://github.com/NixOS/nix/issues/10435) [#12877](https://github.com/NixOS/nix/pull/12877) [#13098](https://github.com/NixOS/nix/pull/13098)

  Previously, we would duplicate entries like `path:/nix/store/*` back into the Nix store.
  This was prominently visible for pinned system flake registry entries in NixOS, e.g., when running `nix run nixpkgs#hello`.

- Consistently preserve error messages from cached evaluation [#12762](https://github.com/NixOS/nix/issues/12762) [#12809](https://github.com/NixOS/nix/pull/12809)

  In one code path, we are not returning the errors cached from prior evaluation, but instead throwing generic errors stemming from the lack of value (due to the error).
  These generic error messages were far less informative.
  Now we consistently return the original error message.

- Faster blake3 hashing [#12676](https://github.com/NixOS/nix/pull/12676)

  The implementation for blake3 hashing is now multi-threaded and used memory-mapped IO.
  Benchmark results can be found the [pull request](https://github.com/NixOS/nix/pull/12676).

- Fix progress bar for S3 binary caches and make file transfers interruptible [#12877](https://github.com/NixOS/nix/issues/12877) [#13098](https://github.com/NixOS/nix/issues/13098) [#12538](https://github.com/NixOS/nix/pull/12538)

  The progress bar now correctly display upload/download progress for S3 up/downloads. S3 uploads are now interruptible.

- Add host attribute of github/gitlab flakerefs to URL serialization [#12580](https://github.com/NixOS/nix/pull/12580)

  Resolved an issue where `github:` or `gitlab:` URLs lost their `host` attribute when written to a lockfile, resulting in invalid URLs.

- Multiple signatures support in store urls [#12976](https://github.com/NixOS/nix/pull/12976)

  Added support for a `secretKeyFiles` URI parameter in Nix store URIs, allowing multiple signing key files to be specified as a comma-separated list.
  This enables signing paths with multiple keys. This helps with [RFC #149](https://github.com/NixOS/rfcs/pull/149) to enable binary cache key rotation in the NixOS infra.

  Example usage:

  ```bash
  nix copy --to "file:///tmp/store?secret-keys=/tmp/key1,/tmp/key2" \
    "$(nix build --print-out-paths nixpkgs#hello)"
  ```

- nix flake show now skips over import-from-derivation [#4265](https://github.com/NixOS/nix/issues/4265) [#12583](https://github.com/NixOS/nix/pull/12583)

  Previously, if a flake contained outputs relying on [import from derivation](@docroot@/language/import-from-derivation.md) during evaluation, `nix flake show` would fail to display the rest of the flake. The updated behavior skips such outputs, allowing the rest of the flake to be shown.

- Add `nix formatter build` and `nix formatter run` commands [#13063](https://github.com/NixOS/nix/pull/13063)

Title: Nix 2.29.0 Release: API, Performance, and Usability Updates
Summary
This segment of the Nix 2.29.0 release notes highlights several significant enhancements. The C API now includes functions for flake locking and loading, complemented by the new `nix-fetchers-c` library. The release also optimizes store management by preventing redundant copying of flakes already present in the Nix store and ensures consistent, informative error messages from cached evaluations. Performance is boosted with faster, multi-threaded blake3 hashing, while S3 binary cache interactions are improved with accurate progress bars and interruptible transfers. Other fixes include preserving the host attribute in `github` and `gitlab` flake reference URLs, adding support for multiple signatures in store URIs, and allowing `nix flake show` to gracefully skip import-from-derivation outputs. Finally, new `nix formatter build` and `nix formatter run` commands have been introduced.