Nix 101 Course / Section 8: Overlays: changes that propagate downstream
Premium

8.3 Surgical overrides: patch one package without rebuilding the world

Lesson 54 of 68 · 6:36

placeholder thumbnail

Sign in, then buy this course to watch

Free account · no credit card needed

About this lesson

A real overlay from a real project: rebuilding OpenCV with GTK window support for a computer vision setup in Python. There are two ways to do it, and they have very different costs. Replace opencv4 for every consumer and trigger a rebuild avalanche, or add a renamed variant and inject it into exactly one application. This lesson shows both, and uses final for the first time.

In this video

  • Overriding opencv4 in an overlay to enable enableGtk3 and Tesseract support, and what that does to every package that depends on it
  • The surgical alternative: a renamed opencv4 twin that only your own app gets, while everything else keeps the cached original
  • Why the surgical route can save you half an hour of OpenCV compile time per machine, times every affected package
  • final vs prev in practice: which reference survives when someone stacks another overlay after yours

After this lesson

You can decide per package whether a change should reach the whole system or exactly one application, and write the overlay for either case.