.\" -*- mode: troff; coding: utf-8 -*- .TH "nix-collect-garbage" "1" "" .SH Name \fCnix-collect-garbage\fR - delete unreachable store paths .SH Synopsis \fCnix-collect-garbage\fR [\fC--delete-old\fR] [\fC-d\fR] [\fC--delete-older-than\fR \fIperiod\fR] [\fC--max-freed\fR \fIbytes\fR] [\fC--dry-run\fR] .SH Description The command \fCnix-collect-garbage\fR is mostly an alias of \fB\fCnix-store --gc\fR\fR (\fInix-store.md#operation---gc\fR), that is, it deletes all unreachable paths in the Nix store to clean up your system. However, it provides two additional options: \fC-d\fR (\fC--delete-old\fR), which deletes all old generations of all profiles in \fC/nix/var/nix/profiles\fR by invoking \fCnix-env --delete-generations old\fR on all profiles (of course, this makes rollbacks to previous configurations impossible); and \fC--delete-older-than\fR \fIperiod\fR, where period is a value such as \fC30d\fR, which deletes all generations older than the specified number of days in all profiles in \fC/nix/var/nix/profiles\fR (except for the generations that were active at that point in time). .SH Example To delete from the Nix store everything that is not used by the current generations of each profile, do .LP .EX $ nix-collect-garbage -d .EE