jzbor/nix-sweep
{ "createdAt": "2025-02-10T16:15:56Z", "defaultBranch": "main", "description": "Utility to clean up old Nix profile generations and left-over garbage collection roots", "fullName": "jzbor/nix-sweep", "homepage": "", "language": "Rust", "name": "nix-sweep", "pushedAt": "2025-11-10T22:07:00Z", "stargazersCount": 55, "topics": [ "nix", "nix-flakes", "nixos" ], "updatedAt": "2025-11-21T14:36:16Z", "url": "https://github.com/jzbor/nix-sweep"}nix-sweep
Section titled “nix-sweep”nix-sweep aims to provide a nice interface for cleaning up old Nix profile generations and left-over garbage collection roots.

Size Calculations
Section titled “Size Calculations”Calculating the size of the Nix paths may take a few moments, especially on older hardware.
If you want to avoid that overhead you can use --no-size to skip size calculations.
Presets
Section titled “Presets”nix-sweep allows you to create presets for clean out criteria, that can then be used with nix-sweep cleanout.
Preset configs are stored as TOML files. If a preset is present in multiple of those files, then the ones further down in the list override ones further up. The following locations are checked for preset files:
/etc/nix-sweep/presets.toml$XDG_CONFIG_HOME/nix-sweep/presets.toml/~/.config/nix-sweep/presets.toml- configuration files passed via
-C/--config
Example:
[housekeeping]keep-min = 10remove-older = 14dinteractive = truegc = falsePresets can be used with the -p (--preset) flag:
nix-sweep -p housekeeping systemnix-sweep -p only-remove-really-old systemnix-sweep -p nuke-everything systemContributing
Section titled “Contributing”Code contributions (pull request) are currently not accepted. If you have any feedback, ideas or bugreports feel free to open a new issue