#!/usr/bin/env nix-shell #!nix-shell -i bash -p bash -p nix # script to reclaim some hard drive space # 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 nix-collect-garbage --delete-older-than 30d 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`