bscpkgs/garlic/pp/rplot.nix
Rodrigo Arias Mallo 8373751f67 rplot: remove suffix from input link
We may have compressed input datasets
2021-03-01 11:41:28 +01:00

35 lines
528 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 ] ++ 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}
'';
}