❮ Blog · Nix · NixOS · Engineering
September 22, 2026 — 2 min read
GC Roots, the fifth free Part of LabCraft's Nix course, is now available. On a real NixOS machine, it asks you to predict what garbage collection will remove before Nix shows you what it kept.
You remove a tool from your Nix profile. The shell can no longer find it. You
run garbage collection to reclaim the space, and its store path is still sitting
in /nix/store.
Nothing is broken. Nix garbage collection has nothing to do with whether something is old, large, or still named by a package. Nix keeps everything reachable from a set of roots and collects the rest, so your path survived because a root still reaches it. That reachability rule is the one idea the Part turns on, and the judgment is in applying it.
GC Roots is the new free Part of LabCraft's Nix course. Across five hands-on labs on a real NixOS machine you find what keeps a path alive, root an output you mean to keep, remove the last root for a path, and run a collection you can account for.
What the labs make you prove
The surprise above has a sharper version the labs put in front of you, and they pose it as a prediction rather than a fact to memorize. You removed one root: what still keeps the path alive? When the last root is gone and a collection runs, what does it actually take? Why does a dependency you were sure you had just freed stay exactly where it is? Is deleting old generations the same as reclaiming their disk?
Across the labs, you build toward a collection you can predict and audit. Each question is one you answer against a real store, not a rule you accept on faith.
Why this became Part 5
Store Paths taught you to name a path. Closures taught you to treat a path and everything it needs as one unit. Profiles and Generations taught you to install, roll back, and retire those units. Every one of them left the same question open: when is the data on disk actually safe to reclaim? GC Roots is the answer, and it closes out the local retention model before the course turns to writing Nix itself.
It runs on a real NixOS machine, because the most honest place to learn what keeps a path alive is a system whose roots, profiles, and shared dependencies are all real and already on disk. You do not write a line of the Nix language. You run real commands, read what the store reports back, and decide what should live and what should go.
Start the Nix course. Predict what a collection will delete before the machine proves you right or wrong.