Nixception: Uncompromising incremental builds inside the sandbox… and outside!

Sandboxed Nix builds are great… until you're rebuilding for the 42nd time.

We wanted fast incremental builds without giving up sandboxing. And we wanted to reuse the same cache both outside build sandboxes during development and inside sandboxed Nix builds.

Turns out that's actually possible with Nixception: an inception of Nix inside Nix that looks like an exception to sandboxing!

The trick is surprisingly simple. Nixception speaks the Remote Build Execution (RBE) protocol on one side and the Nix daemon protocol on the other. Every remote execution request becomes a regular Nix derivation, built and cached by Nix itself. Nixception stores almost no state of its own; the Nix store is the cache. It all works thanks to the unloved recursive-nix feature which makes the same nix daemon available inside the build sandboxes. So they share the same build caches inside and outside the sandbox.

This means any tool that already speaks RBE (Bazel, Buck2, etc) can use nix as their remote execution service. For tools that don't, RECC (think ccache/distcc/sccache, but for RBE) makes C/C++ builds benefit from the same mechanism.

In this talk we will cover the benefits of the tool in several common use cases, including performance benchmarks. We will also cover conceptual aspects of composing build systems, and how this design compares with similar projects. We will also cover interesting implementation details and challenges we encountered trying to translate one model into the other, both ways.

Welcome to all the curious people, and please bring questions!

Guillaume Maudoux (@layus)

Guillaume Maudoux (a.k.a @layus on GitHub and elsewhere) is an engineer and researcher specialized in build systems.

Based in Belgium, Guillaume blends a background in computer science, engineering, and applied mathematics with strong interests in correctness, reliability, and efficiency in software systems.

Guillaume works at Tweag’s Scalable Build Systems group. A team of engineers and researchers focused on developer productivity, robust tooling, and enterprise-scale build performance. His work focusses on integrating Nix into Bazel and in particular supporting remote execution. For some reason his skills are most appreciated in the robotics industry.

You may find him contributing to random open source projects because he never resists fixing a bug he found, and digging to uncover the root cause of problems. He will happily share his findings in blogs, conferences or around a coffeeC-w tea.

Guillaume’s reputation stems from his ability to bridge academic rigor with systems engineering pragmatism. His work helps teams build complex software more reliably, efficiently, and at scale.