9.9 Anti-patterns: why you do not need flake-utils or flake-parts
Lesson 67 of 68 · 13:37
Up next in 5s…
About this lesson
Almost every flakes tutorial reaches for flake-utils or flake-parts to handle multiple architectures. This lesson makes the case that you usually need neither, and shows live how removing them leaves your flake.nix shorter, supporting more platforms, and with fewer inputs to drag around.
In this video
- What
eachDefaultSystemreally gives you, and the platforms it silently locks out - Watching transitive flake inputs pile up with
flake-du, and why fifteen copies of the same helper is a normal sight in the wild - The two-line replacement pattern, no extra input required
flake-partsand itsnixpkgs-libinput: when the module system is worth it, and when it is far too much for a list of systems- The Nixcademy article behind this lesson, about a thousand instances of flake-utils
After this lesson
You can strip helper libraries out of your flakes with confidence, and justify the decision to your team with measurements instead of taste.
Builds on: Starting a flake from scratch with nix flake init (9.4)
Links: