I feel your pain on this one despite being fairly comfortable with nix by now. This is 100% an issue either the documentation or the nix CLI should do a better job at.
The wiki rightfully points towards "roots", i.e. references produced by nix-build or similar. Additionally, there are other places that will keep references and hence block garbage collection though:
1. Your nix profile (`nix profile list` / `nix profile remove`) and its old generations (`nix profile (wipe-)history`)
2. Your NixOS configuration (configuration.nix) and its old generations (`nixos-rebuild list-generations`)
It doesn't help that there's no discoverable way to tell why a particular nix store path is not being garbage collected either.
The wiki rightfully points towards "roots", i.e. references produced by nix-build or similar. Additionally, there are other places that will keep references and hence block garbage collection though:
1. Your nix profile (`nix profile list` / `nix profile remove`) and its old generations (`nix profile (wipe-)history`)
2. Your NixOS configuration (configuration.nix) and its old generations (`nixos-rebuild list-generations`)
It doesn't help that there's no discoverable way to tell why a particular nix store path is not being garbage collected either.