4.2 Inside the Nix build sandbox
Lesson 25 of 68 · 28:38
Up next in 5s…
About this lesson
Every Nix build runs in a sealed off mini world: no internet, no home folder, almost no files. In this lesson we break into that world and look around. Afterwards you know why "works on my machine" problems cannot happen with Nix.
In this video
- Building the smallest possible derivation: four parameters and one shell script
- The environment inside the sandbox: a handful of variables with strange values like
HOME=/homeless-shelter, and why that is a feature - A tour of the sandbox file system: what is in
/bin,/dev,/procand/etc, and what is missing - Watching internet access fail on purpose, and what that buys you
- The contract between Nix and your build script, and the one variable everything depends on
After this lesson
When a real build fails later, you know exactly what world it failed in. This is the lesson that turns build debugging from guessing into inspection.