9.7 Exercise: flakify a real project
Lesson 65 of 68 · 20:07
Up next in 5s…
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:
- Exercise repository: https://github.com/nixcademy/multi-project-repo
- Solution branch: https://github.com/nixcademy/multi-project-repo/tree/solution-flake