8.5 final vs prev: the two rule flavors
Lesson 56 of 68 · 12:22
Up next in 5s…
About this lesson
Both final and prev are versions of nixpkgs, so which one do you write in your overlay? Even experienced Nix people give contradicting answers in the forums, and there is a reason: two competing rule sets exist. This lesson shows where the two references come from in the overlay application graph, then lays out both flavors so you and your team can pick one and stay consistent.
In this video
- The overlay application graph: where
prevandfinalpoint when several overlays stack on top of nixpkgs - The one combination that always ends in infinite recursion, traced on the graph
- Flavor one, graph preserving:
prevby default,finalonly when referencing one package from another - Flavor two, everything is overridable:
finalby default,prevonly when overriding a package with itself - The grafting idea behind flavor one, the nixpkgs pull request that never got merged, and which flavor most teams actually choose today
After this lesson
You never guess between final and prev again. You apply one rule flavor consistently and can explain the trade-off behind the choice to your team.