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:
parent
68ab6faeb3
commit
b0098f1c8e
5 changed files with 21 additions and 3 deletions
|
@ -46,6 +46,7 @@
|
||||||
openwrt = callPackage ./openwrt {};
|
openwrt = callPackage ./openwrt {};
|
||||||
|
|
||||||
initramfs-peek = callPackage ./initramfs-peek {};
|
initramfs-peek = callPackage ./initramfs-peek {};
|
||||||
|
min-collect-garbage = callPackage ./min-collect-garbage {};
|
||||||
min-copy-closure = callPackage ./min-copy-closure {};
|
min-copy-closure = callPackage ./min-copy-closure {};
|
||||||
hi = callPackage ./hi {};
|
hi = callPackage ./hi {};
|
||||||
}
|
}
|
||||||
|
|
17
pkgs/min-collect-garbage/default.nix
Normal file
17
pkgs/min-collect-garbage/default.nix
Normal 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
|
||||||
|
'';
|
||||||
|
}
|
3
pkgs/min-collect-garbage/min-collect-garbage.sh
Executable file
3
pkgs/min-collect-garbage/min-collect-garbage.sh
Executable 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)
|
|
@ -19,7 +19,6 @@ int add_list_entry(char *name)
|
||||||
hash_list = realloc(hash_list, hash_list_size * sizeof(hash_t));
|
hash_list = realloc(hash_list, hash_list_size * sizeof(hash_t));
|
||||||
}
|
}
|
||||||
strncpy(hash_list[hash_list_entries++], name, 32);
|
strncpy(hash_list[hash_list_entries++], name, 32);
|
||||||
printf("%d %d\n", hash_list_entries, hash_list_size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int read_list(char *filename)
|
int read_list(char *filename)
|
|
@ -8,13 +8,11 @@
|
||||||
buildInputs = [ ];
|
buildInputs = [ ];
|
||||||
propagatedBuildInputs = [ cpio openssh nix ];
|
propagatedBuildInputs = [ cpio openssh nix ];
|
||||||
src = ./.;
|
src = ./.;
|
||||||
makeFlags = [ "min-list-garbage" ];
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
for i in min-copy-closure liminix-rebuild; do
|
for i in min-copy-closure liminix-rebuild; do
|
||||||
echo $i
|
echo $i
|
||||||
cp ''${i}.sh $out/bin/$i
|
cp ''${i}.sh $out/bin/$i
|
||||||
done
|
done
|
||||||
cp min-list-garbage $out/bin
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue