35 lines
536 B
Nix
35 lines
536 B
Nix
{
|
|
stdenv
|
|
, rWrapper
|
|
, rPackages
|
|
}:
|
|
|
|
{
|
|
# The two results to be compared
|
|
dataset
|
|
, script
|
|
, extraRPackages ? []
|
|
}:
|
|
|
|
with stdenv.lib;
|
|
|
|
let
|
|
customR = rWrapper.override {
|
|
packages = with rPackages; [ tidyverse viridis ] ++ extraRPackages;
|
|
};
|
|
|
|
in stdenv.mkDerivation {
|
|
name = "plot";
|
|
buildInputs = [ customR ];
|
|
preferLocalBuild = true;
|
|
dontPatchShebangs = true;
|
|
phases = [ "installPhase" ];
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cd $out
|
|
ln -s ${dataset} input
|
|
Rscript --vanilla ${script} ${dataset}
|
|
'';
|
|
}
|