nix-collect-garbagedetermine the set of unreachable store pathsnix-collect-garbageDescription
The command nix-collect-garbage determines
the paths in the Nix store that are garbage, that is, not
reachable from outside of the store. These paths can be safely
deleted without affecting the integrity of the system.
Options
Causes the set of reachable paths to
be printed, rather than the unreachable paths. These are
the paths that may not be deleted.
Causes nix-collect-garbage not to
follow successor relations. By default, if a derivation
store expression is reachable, its successor (i.e., a
closure store expression) is also considered to be
reachable. This option is always safe, but garbage
collecting successors may cause undesirable rebuilds later
on.
Examples
To delete all unreachable paths, do the following:
$ nix-collect-garbage | xargs nix-store --delete