diff --git a/pages/common/nix-collect-garbage.md b/pages/common/nix-collect-garbage.md new file mode 100644 index 0000000000..12f1694970 --- /dev/null +++ b/pages/common/nix-collect-garbage.md @@ -0,0 +1,16 @@ +# nix-collect-garbage + +> Delete unused and unreachable nix store paths. +> Generations can be listed using `nix-env --list-generations`. + +- Delete all store paths unused by current generations of each profile: + +`sudo nix-collect-garbage --delete-old` + +- Simulate the deletion of old store paths: + +`sudo nix-collect-garbage --delete-old --dry-run` + +- Delete all store paths older than 30 days: + +`sudo nix-collect-garbage --delete-older-than {{30d}}`