9.8 Real life flakes: how experienced users structure them
Lesson 66 of 68 · 11:17
Up next in 5s…
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 flakein.envrc: a dev shell that loads itself the moment you enter the folder- Why keeping
callPackagecalls out offlake.nixleaves users free to bring their own nixpkgs - A
formatterblock that drives nixfmt, statix, rustfmt, taplo, prettier and shellcheck from onenix 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:
- Flakified Nixery fork walked through in the video: https://github.com/tfc/nixery
- The original Nixery project: https://github.com/tazjin/nixery
- Rust example project: https://github.com/applicative-systems/gcan
- Rust build framework used there: https://github.com/nix-community/naersk