5.1 The build dance: from ./configure to your first mkDerivation
Lesson 30 of 68 · 9:07
Up next in 5s…
About this lesson
Almost every open source package installs the same way: download, unpack, ./configure, make, make install. In this lesson we build GNU hello by hand first, then let stdenv.mkDerivation do the whole ritual from a few lines of Nix. You see why the classic build dance maps directly onto Nix build phases, and why mkDerivation is the function behind nearly every package in nixpkgs.
In this video
- The manual build dance:
wget,tar,./configure,make,make check, and whymake installneedssudoon a normal system - What the configure step actually discovers about your machine, and how these steps got names like unpack phase and build phase
- Building the same package with a
mkDerivationcall that fits in a handful of lines, with no compiler installed in your shell - Where the finished package lands instead of
/usr/local/bin, and installing and removing it withnix profile - Why
buildGoModule,buildRustPackage, andbuildPythonPackageall stand onmkDerivation, so this one function pays off everywhere
After this lesson
You can turn a standard configure-and-make project into a real Nix package with a few lines of Nix, and you know the phase names that the rest of this section builds on.
Builds on: The derivation is a recipe (4.3)