Why it is needed to do `final: prev: { ... }` when creating an overlay

Hi!

I am not an overlay expert, I found:

The comments after # explain it a little

final: # package set with all overlays applied, a "fixed" point
prev: # state of the package set before applying this overlay
{
  my-new-package = prev.hello;
  some-other-package = final.my-new-package;
}

from:

https://discourse.nixos.org/t/what-are-overlays/14680/2

also this tries to explain:

https://nixos.wiki/wiki/Overlays

1 Like