Nix 101 Course / Section 9: Flakes
Premium

9.8 Real life flakes: how experienced users structure them

Lesson 66 of 68 · 11:17

placeholder thumbnail

Sign in, then buy this course to watch

Free account · no credit card needed

About this lesson

How do experienced Nix users actually structure their flakes? This lesson reads real repositories: tazjin's Nixery with a flakified build layered on top, and a Rust CLI built with naersk, direnv, treefmt and a full checks setup. You see the overlay-centric layout that keeps a flake composable instead of locking its users in.

In this video

  • use flake in .envrc: a dev shell that loads itself the moment you enter the folder
  • Why keeping callPackage calls out of flake.nix leaves users free to bring their own nixpkgs
  • A formatter block that drives nixfmt, statix, rustfmt, taplo, prettier and shellcheck from one nix fmt
  • Clippy and cargo tests wired into checks, so CI is exactly one command
  • The habits that make a flake pleasant to inherit, and the ones that make consultants sigh

After this lesson

You can tell a well-structured flake from a tangled one at a glance, and you have a concrete model to copy for your own projects.

Builds on: Flake outputs in depth: packages, apps, checks and more (9.6)

Links: