Utility to clean up old Nix profile generations and left-over garbage collection roots
Find a file
2025-12-12 22:44:08 +01:00
.github/workflows Adding arm CI 2025-02-10 20:50:54 +01:00
src Release 0.8.0 2025-11-10 23:06:36 +01:00
.gitignore Initial commit 2025-02-10 17:15:42 +01:00
Cargo.lock Release 0.8.0 2025-11-10 23:06:36 +01:00
Cargo.toml Release 0.8.0 2025-11-10 23:06:36 +01:00
flake.lock Release 0.8.0 2025-11-10 23:06:36 +01:00
flake.nix flake: Rename 'system' to 'stdenv.hostPlatform.system' (fixes #4) 2025-12-12 22:44:08 +01:00
LICENSE Create LICENSE 2025-07-07 10:17:21 +02:00
README.md README: Remove outdated parts 2025-07-23 22:09:27 +02:00

nix-sweep

nix-sweep aims to provide a nice interface for cleaning up old Nix profile generations and left-over garbage collection roots.

nix-sweep demo

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

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 = 10
remove-older = 14d
interactive = true
gc = false

Presets can be used with the -p (--preset) flag:

nix-sweep -p housekeeping system
nix-sweep -p only-remove-really-old system
nix-sweep -p nuke-everything system

Contributing

Code contributions (pull request) are currently not accepted. If you have any feedback, ideas or bugreports feel free to open a new issue