Skip to content

Build helpers

A build helper is a function that produces derivations.

Warning

This is not to be confused with the builder argument of the Nix derivation primitive, which refers to the executable that produces the build result, or remote builder, which refers to a remote machine that could run such an executable.

Such a function is usually designed to abstract over a typical workflow for a given programming language or framework. This allows declaring a build recipe by setting a limited number of options relevant to the particular use case instead of using the derivation function directly.

stdenv.mkDerivation is the most widely used build helper, and serves as a basis for many others. In addition, it offers various options to customize parts of the builds.

There is no uniform interface for build helpers. Trivial build helpers and fetchers have various input types for convenience. Language- or framework-specific build helpers usually follow the style of stdenv.mkDerivation, which accepts an attribute set or a fixed-point function taking an attribute set.