NixCon 2024

Integrating Nix and Buck2 for fun and profit
2024-10-26 , Arena

In a large code base you want a tool that is able to build your project quickly by leveraging features such as a distributed cache and remote execution. At the same time it is important that your build is correct and thus reproducible.

In this talk I will present how we integrated Nix with Buck2, an open source build system developed by Meta, in order to achieve highly granular, reproducible builds for a large Haskell code base and how we were able to use Buck2's remote execution with Nix.


In this talk I will quickly introduce Buck2 and the project we are working on to explain the goals we were aiming to achieve in regard to the developer experience.

In brief, Buck2 should be the main entry point to the project – providing a buck2 binary in a dev shell is all that is needed to get a developer going on the project.

Therefore, we developed a fine-grained mechanism for introducing nix packages as dependencies in our build using nix flakes.

I will deep dive into the internals of this integration, demonstrate how easy it is to use, and how we can speed up the build even more using a distributed cache and remote execution.


What level of experience in Nix is the talk addressed to?:

This talk is mainly about integrating Nix with Buck2 but touches upon a few Nix concepts such as flakes, derivations and closures. Intermediate experience with Nix and these concepts is recommended.

Do you allow your talk to be recorded?: yes

Claudio is a software engineer with a passion for functional programming and with a strong interest in build systems. He is a member of the Scalable Builds Group at Modus Create and contributes to Bazel and Buck2, maintains Bazel rules for Tweag (Modus Create's OSPO), and provides professional services to various clients. He lives in Leipzig with his wife and kids.