Back to NixOS Foundation
GSoC 2026

Remove the Build Hook Mechanism, Store Extensions

The Nix build hook mechanism has been marked for removal since 2017, but it still fills an important gap in Nix's distributed build architecture. In particular, it is currently the only interface that can pass a build request together with its full set of input paths atomically. Store-based remote building does not provide this: it splits the process into separate calls, which makes it difficult for builder stores that schedule builds across a cluster, such as "nix-scheduler-hook", to know where inputs need to be copied before the build is assigned. This project proposes a cleaner, more extensible replacement by adding a new virtual "buildDerivation" method to the "Store" base class. This method would bundle the derivation path, derivation, and input paths into a single call, preserving the atomic behavior that cluster schedulers rely on. To ensure compatibility, the new interface would include a default implementation so that existing store backends continue to work unchanged. The project will validate this design through an end-to-end proof of concept by adapting "nix-scheduler-hook" to use the new API. Once the new mechanism is confirmed to support distributed scheduling correctly, the legacy build hook mechanism can be removed from the Nix daemon. Expected deliverables include the new virtual "Store" method and its default implementation, full removal of the build hook mechanism from the Nix daemon, a proof-of-concept "nix-scheduler-hook" adaptation, a passing distributed build test suite, and accompanying API documentation and migration guidance.

Project details

Contributor

Amrit Amber

Mentors

Not available

Technologies

Not listed in the archive