mirror of
https://github.com/ilyakooo0/nix-bundle.git
synced 2024-09-11 06:55:53 +03:00
18 lines
475 B
Nix
18 lines
475 B
Nix
{ stdenv, perl, pathsFromGraph }:
|
|
|
|
{ name, toplevel }:
|
|
|
|
stdenv.mkDerivation {
|
|
inherit toplevel name;
|
|
exportReferencesGraph = [ "closure" toplevel ];
|
|
buildInputs = [ perl ];
|
|
buildCommand = ''
|
|
mkdir -p $out
|
|
storePaths=$(${perl}/bin/perl ${pathsFromGraph} ./closure)
|
|
printRegistration=1 ${perl}/bin/perl ${pathsFromGraph} ./closure > $out/.reginfo
|
|
for path in $storePaths; do
|
|
cp --parents -rp $path $out/
|
|
done
|
|
'';
|
|
}
|