Nix 101 Course / Section 9: Flakes
Premium

9.9 Anti-patterns: why you do not need flake-utils or flake-parts

Lesson 67 of 68 · 13:37

placeholder thumbnail

Sign in, then buy this course to watch

Free account · no credit card needed

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 eachDefaultSystem really 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-parts and its nixpkgs-lib input: 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: