min-list-garbage: check all store paths against file

this is step 1 of min-collect-garbage, no point implementing
deletion ourselves when rm -r exists

(arguably no point in implementing any of it, but this is the bit we
can't do efficiently in bourne shell - it means we're reading the
store-paths list once instead of grepping it afresh for every entry in
/nix/store/)
This commit is contained in:
Daniel Barlow
2023-05-19 23:49:11 +01:00
parent a809c28dde
commit 00aeb81811
2 changed files with 85 additions and 2 deletions

View File

@@ -8,9 +8,13 @@
buildInputs = [ ];
propagatedBuildInputs = [ cpio openssh nix ];
src = ./.;
makeFlags = [ "min-list-garbage" ];
installPhase = ''
mkdir -p $out/bin
cp min-copy-closure.sh $out/bin/min-copy-closure
cp liminix-rebuild.sh $out/bin/liminix-rebuild
for i in min-copy-closure liminix-rebuild; do
echo $i
cp ''${i}.sh $out/bin/$i
done
cp min-list-garbage $out/bin
'';
}