22 lines
510 B
Nix
22 lines
510 B
Nix
{
|
|
lib,
|
|
runCommand,
|
|
}:
|
|
{
|
|
name,
|
|
pkgList,
|
|
fileGlobs ? [ "bin/*" "lib/*"],
|
|
fileFindPredicates ? "-type f",
|
|
pkgProcessor ? pkg: pkg,
|
|
}:
|
|
let
|
|
processedList = map pkgProcessor pkgList;
|
|
globPredicates = lib.concatMapStringsSep " " (g: "-find ${g}") fileGlobs;
|
|
copiedBins = runCommand name {} ''
|
|
mkdir -p $out/bins
|
|
find ${lib.concatStringsSep " " processedList} ${globPredicates} ${fileFindPredicates}| while read -r filepath; do
|
|
cp "$filepath" $out/bins
|
|
done
|
|
'';
|
|
in copiedBins
|