forked from rarias/bscpkgs
ds: link the resultTree in the dataset
This commit is contained in:
34
garlic/ds/py.nix
Normal file
34
garlic/ds/py.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
stdenv
|
||||
, python3
|
||||
, gzip
|
||||
}:
|
||||
|
||||
{
|
||||
script,
|
||||
compress ? true
|
||||
}:
|
||||
|
||||
tree:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "dataset";
|
||||
preferLocalBuild = true;
|
||||
phases = [ "installPhase" ];
|
||||
buildInputs = [ python3 gzip ];
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
ln -s ${tree} $out/tree
|
||||
ln -s ${script} $out/script
|
||||
|
||||
COMPRESS_DATASET=${toString compress}
|
||||
|
||||
if [ $COMPRESS_DATASET ]; then
|
||||
python $out/script $out/tree | gzip > $out/dataset.json.gz
|
||||
ln -s dataset.json.gz $out/dataset
|
||||
else
|
||||
python $out/script $out/tree > $out/dataset.json
|
||||
ln -s dataset.json $out/dataset
|
||||
fi
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user