2.3 Nix syntax: the complete tour
Lesson 10 of 68 · 40:38
Up next in 5s…
About this lesson
One video, the whole Nix syntax. This Nix language tutorial covers attribute sets, functions, let and in blocks, string interpolation and imports, plus the constructs you should recognize but avoid. After it, real world Nix code stops looking cryptic.
In this video
- Attribute sets,
inherit, the?test and theorfallback operator (no, inherit has nothing to do with object orientation) - Functions, currying and partial application, explained side by side with Python lambdas
- Attribute set parameters with default values, the
...ellipsis, and one@pattern that is a genuine anti-pattern - Scoping with
letandin, and thewithconstruct with its variable shadowing trap - Multi-line strings and interpolation, merging sets with
//and its surprise on nested sets, and importing Nix files
After this lesson
You can read almost any Nix expression in the wild, and you know which constructs are good style and which ones will hurt the next reader.