2020-10-21 18:18:43 +02:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, rWrapper
|
|
|
|
, rPackages
|
|
|
|
}:
|
|
|
|
|
|
|
|
{
|
|
|
|
# The two results to be compared
|
|
|
|
dataset
|
|
|
|
, script
|
|
|
|
, extraRPackages ? []
|
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
customR = rWrapper.override {
|
|
|
|
packages = with rPackages; [ tidyverse ] ++ extraRPackages;
|
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
name = "plot";
|
|
|
|
buildInputs = [ customR ];
|
|
|
|
preferLocalBuild = true;
|
|
|
|
dontPatchShebangs = true;
|
|
|
|
phases = [ "installPhase" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cd $out
|
2020-11-11 18:59:57 +01:00
|
|
|
ln -s ${dataset} input.json
|
2020-10-21 18:18:43 +02:00
|
|
|
Rscript --vanilla ${script} ${dataset}
|
|
|
|
'';
|
|
|
|
}
|