From afd52014d19020b45606d466d964324565e23109 Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 26 Feb 2024 15:25:12 +0000 Subject: [PATCH] sane-reclaim-disk-space: note to run as root --- pkgs/additional/sane-scripts/src/sane-reclaim-disk-space | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/additional/sane-scripts/src/sane-reclaim-disk-space b/pkgs/additional/sane-scripts/src/sane-reclaim-disk-space index 272add16c..e0514b13a 100755 --- a/pkgs/additional/sane-scripts/src/sane-reclaim-disk-space +++ b/pkgs/additional/sane-scripts/src/sane-reclaim-disk-space @@ -1,5 +1,6 @@ #!/usr/bin/env nix-shell #!nix-shell -i bash -p nix + # script to reclaim some hard drive space # some of this is documented here: # - @@ -12,8 +13,6 @@ set -xeu # TODO: `nix-store --gc`? nix-collect-garbage --delete-older-than 30d -# TODO: could use dduper: https://github.com/Lakshmipathi/dduper -# like rmlint, but better perf for btrfs (checksum tests) -# likely also better compression, on account of being block-based instead of whole-file based. -# however, not clearly actively maintained; uses custom btrfs-progs patch; riskier -# might not currently build on nix: https://github.com/NixOS/nixpkgs/issues/175730 +if [ "$(id -u)" -ne 0 ]; then + echo "now re-run as root to free old system-level generations" +fi