Nix 101 Course / Section 9: Flakes
Premium

9.7 Exercise: flakify a real project

Lesson 65 of 68 · 20:07

placeholder thumbnail

Sign in, then buy this course to watch

Free account · no credit card needed

About this lesson

Now it is your turn. You get a project you already know from the overlays section, complete with release.nix, shell.nix and an overlay file, and the task is to flakify it: same packages, same dev shell, now served through a flake.nix. This is where the template knowledge from the previous lessons turns into a skill you can use on your own repositories.

In this video

  • Reusing the existing overlay instead of copying package definitions into the flake
  • A gotcha that hits almost everyone in git repositories: the flake insists your new file does not exist
  • Filtering outputs per platform, because a cross-compiled ARM package makes no sense on an ARM host
  • Both flake templates applied to the same project, so you can compare them on real code
  • Two lock files in one repository, and a way to end up with a single source of truth for pinning

After this lesson

You have converted a non-flake project to flakes yourself, without duplicating a single package definition, and you know how to keep flake and non-flake workflows living side by side.

Builds on: Exercise: overlay across the dep tree (8.7)

Links: