Home Explore Blog CI



nix

1st chunk of `doc/manual/source/release-notes/rl-2.28.md`
05eade5498ea77565d681954d2288692bdd64b3371aab4e10000000100000a20
# Release 2.28.0 (2025-04-02)

This is an atypical release, and for almost all intents and purposes, it is just a continuation of 2.27; not a feature release.

We had originally set the goal of making 2.27 the Nixpkgs default for NixOS 25.05, but dependents that link to Nix need certain _interface breaking_ changes in the C++ headers. This is not something we should do in a patch release, so this is why we branched 2.28 right off 2.27 instead of `master`.

This completes the infrastructure overhaul for the [RFC 132](https://github.com/NixOS/rfcs/blob/master/rfcs/0132-meson-builds-nix.md) switchover to meson as our build system.

## Major changes

- Unstable C++ API reworked
  [#12836](https://github.com/NixOS/nix/pull/12836)
  [#12798](https://github.com/NixOS/nix/pull/12798)
  [#12773](https://github.com/NixOS/nix/pull/12773)

  Now the C++ interface confirms to common conventions much better than before:

  - All headers are expected to be included with the initial `nix/`, e.g. as `#include "nix/....hh"` (what Nix's headers now do) or `#include <nix/....hh>` (what downstream projects may choose to do).
    Likewise, the pkg-config files have `-I${includedir}` not `-I${includedir}/nix` or similar.

    Including without the `nix/` like before sometimes worked because of how for `#include` C pre-process checks the directory containing the current file, not just the lookup path, but this was not reliable.

  - All configuration headers are included explicitly by the (regular) headers that need them.
    There is no more need to pass `-include` to force additional files to be included.

  - The public, installed configuration headers no longer contain implementation-specific details that are not relevant to the API.
    The vast majority of definitions that were previously in there are now moved to new headers that are not installed, but used during Nix's own compilation only.
    The remaining macro definitions are renamed to have `NIX_` as a prefix.

  - The name of the Nix component the header comes from
    (e.g. `util`, `store`, `expr`, `flake`, etc.)
    is now part of the path to the header, coming after `nix` and before the header name
    (or rest of the header path, if it is already in a directory).

  Here is a contrived diff showing a few of these changes at once:

  ```diff
  @@ @@
  -#include "derived-path.hh"
  +#include "nix/store/derived-path.hh"
  @@ @@
  +// Would include for the variables used before. But when other headers
  +// need these variables. those will include these config themselves.
  +#include "nix/store/config.hh"

Title: Nix Release 2.28.0: Focus on C++ API Rework and Meson Build System
Summary
Nix release 2.28.0 is primarily a continuation of 2.27, intended to address interface-breaking changes in the C++ headers required by Nix dependents. This release completes the infrastructure overhaul for the RFC 132 Meson build system switchover and includes a major rework of the unstable C++ API to improve conventions and reliability. Key changes include standardized header inclusion with the `nix/` prefix, explicit inclusion of configuration headers, removal of implementation details from public headers, renaming of macros with the `NIX_` prefix, and incorporation of component names into header paths.