Nix derivations

A Nix expression which describes a build action is called a derivation. The result (since a derivation is a function) of a derivation is an object in the Nix store.

Derivations are constructed using stdenv.mkDerivation as in Hello, Nix!

Minimal attributes

  • name - default value is ${pname}-${version}
  • pname - package name
  • version - version string
  • src - result of a source fetching function like fetchurl or fetchgit

Common optional attributes

  • builder - a Nix builder script describing the build process for the package (defaults to configure; make; make install)