nixpkgs/pkgs/development/r-modules/generic/wrapper.nix
Peter Simons 7c6a730e0b R: added wrapper script that provides "R" and "Rscript" binaries that know about extra libraries
Configure an override in ~/.nixpkgs/config.nix as follows:

  {
    packageOverrides = pkgs: {

      rWrapper = pkgs.rWrapper.override {
        packages = with pkgs.rPackages; [ Defaults dataTable foreach xtable ];
      };

    };
  }
2014-05-04 15:33:15 +02:00

19 lines
354 B
Nix

{ stdenv, R, packages, makeWrapper }:
stdenv.mkDerivation {
name = R.name + "-wrapper";
buildInputs = [makeWrapper R] ++ packages;
unpackPhase = ":";
installPhase = ''
mkdir -p $out/bin
cd ${R}/bin
for exe in *; do
makeWrapper ${R}/bin/$exe $out/bin/$exe \
--prefix "R_LIBS_SITE" ":" "$R_LIBS_SITE"
done
'';
}