diff --git a/pkgs/additional/sane-scripts/src/sane-reclaim-disk-space b/pkgs/additional/sane-scripts/src/sane-reclaim-disk-space index e0514b13..f39e9152 100755 --- a/pkgs/additional/sane-scripts/src/sane-reclaim-disk-space +++ b/pkgs/additional/sane-scripts/src/sane-reclaim-disk-space @@ -5,14 +5,20 @@ # some of this is documented here: # - +if [ "$(id -u)" -ne 0 ]; then + echo 'must be run as root!' +fi + set -xeu # scan the store and hard-link identical files # nix-store --optimise -# TODO: `nix-store --gc`? nix-collect-garbage --delete-older-than 30d -if [ "$(id -u)" -ne 0 ]; then - echo "now re-run as root to free old system-level generations" -fi +set +x + +echo 'to free more space (e.g. boot space), manually manage the profiles' +echo '- nix-env --profile /nix/var/nix/profiles/system --list-generations' +echo '- nix-env --profile /nix/var/nix/profiles/system --delete-generations {first..last}' +echo '- sudo sane-reclaim-boot-space`