forked from colin/nix-files
sane-reclaim-disk-space: note to run as root
This commit is contained in:
parent
dd6e1c5e38
commit
afd52014d1
@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i bash -p nix
|
#!nix-shell -i bash -p nix
|
||||||
|
|
||||||
# script to reclaim some hard drive space
|
# script to reclaim some hard drive space
|
||||||
# some of this is documented here:
|
# some of this is documented here:
|
||||||
# - <https://nixos.wiki/wiki/Storage_optimization>
|
# - <https://nixos.wiki/wiki/Storage_optimization>
|
||||||
@ -12,8 +13,6 @@ set -xeu
|
|||||||
# TODO: `nix-store --gc`?
|
# TODO: `nix-store --gc`?
|
||||||
nix-collect-garbage --delete-older-than 30d
|
nix-collect-garbage --delete-older-than 30d
|
||||||
|
|
||||||
# TODO: could use dduper: https://github.com/Lakshmipathi/dduper
|
if [ "$(id -u)" -ne 0 ]; then
|
||||||
# like rmlint, but better perf for btrfs (checksum tests)
|
echo "now re-run as root to free old system-level generations"
|
||||||
# likely also better compression, on account of being block-based instead of whole-file based.
|
fi
|
||||||
# however, not clearly actively maintained; uses custom btrfs-progs patch; riskier
|
|
||||||
# might not currently build on nix: https://github.com/NixOS/nixpkgs/issues/175730
|
|
||||||
|
Loading…
Reference in New Issue
Block a user