Home Explore Blog CI



nix

2nd chunk of `doc/manual/source/release-notes/rl-2.29.md`
cc20a6618e2159122104cf3bcacbd6c19c231104b0b3e0b50000000100000dc6
  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 - C API, Error Handling, Hashing, S3 Progress, and Flake Improvements
Summary
Nix 2.29.0 introduces C API functions for flake locking, a new `nix-fetchers-c` library, and prevents copying flakes already in the Nix store. It also improves error message consistency, speeds up blake3 hashing, fixes the S3 progress bar, preserves host attributes in github/gitlab flakerefs, supports multiple signatures in store URLs, skips over import-from-derivation in `nix flake show`, and adds `nix formatter build` and `nix formatter run` commands.