Skip to content

Nix Pills - Chapter 11 - Garbage Collector⚓︎

Nix nix-collect-garbage first moves dead store paths to /nix/store/trash, which is an atomic operation, and then the trash is emptied.

All profiles and their generations are GC roots. This means that you must remove references to derivations from profiles and generations before nix-collect-garbage will remove the derivation.

nix-collect-garbage -d is used to delete old generations of all profiles, then collect garbage. After this, you’ll lose the ability to rollback to any previous generation.