move min-list-garbage into min-collect-garbage pkg

we don't want it in the same package as min-copy-closure as
that depends on bash
This commit is contained in:
Daniel Barlow 2023-05-20 21:09:22 +01:00
parent 68ab6faeb3
commit b0098f1c8e
5 changed files with 21 additions and 3 deletions

View file

@ -46,6 +46,7 @@
openwrt = callPackage ./openwrt {};
initramfs-peek = callPackage ./initramfs-peek {};
min-collect-garbage = callPackage ./min-collect-garbage {};
min-copy-closure = callPackage ./min-copy-closure {};
hi = callPackage ./hi {};
}

View file

@ -0,0 +1,17 @@
{
stdenv
, nix
, cpio
, openssh
}: stdenv.mkDerivation {
name = "min-collect-garbage";
buildInputs = [ ];
# propagatedBuildInputs = [ openssh ];
src = ./.;
makeFlags = [ "min-list-garbage" ];
installPhase = ''
mkdir -p $out/bin
cp min-collect-garbage.sh $out/bin/min-collect-garbage
cp min-list-garbage $out/bin
'';
}

View file

@ -0,0 +1,3 @@
#!/bin/sh
test -f /persist/nix-store-paths || exit 1
(cd /nix/store && min-list-garbage /persist/nix-store-paths | xargs rm -r)

View file

@ -19,7 +19,6 @@ int add_list_entry(char *name)
hash_list = realloc(hash_list, hash_list_size * sizeof(hash_t));
}
strncpy(hash_list[hash_list_entries++], name, 32);
printf("%d %d\n", hash_list_entries, hash_list_size);
}
int read_list(char *filename)

View file

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