bscpkgs/garlic/pp/merge.nix

25 lines
336 B
Nix
Raw Normal View History

{
stdenv
2022-09-01 16:27:29 +02:00
, lib
}:
2021-05-03 12:48:49 +02:00
datasets:
2022-09-01 16:27:29 +02:00
with lib;
stdenv.mkDerivation {
2021-05-03 12:48:49 +02:00
name = "merged-dataset";
preferLocalBuild = true;
phases = [ "installPhase" ];
2021-05-03 12:48:49 +02:00
inherit datasets;
installPhase = ''
2021-05-03 12:48:49 +02:00
mkdir -p $out
n=1
for d in $datasets; do
ln -s $d $out/$n
let n=n+1
cat $d/dataset >> $out/dataset
done
'';
}