rstudio: Fix recompilation issue with custom package set

This attempts to fix the issue described at
https://github.com/NixOS/nixpkgs/pull/22219#issuecomment-291801133.
Any change to the custom packages passed to RStudio causes this to
completely rebuild RStudio, which is completely unnecessary and also a
bit of a hindrance as it's a fairly slow build.

This rolls back most of that old PR, and instead implements something
more like rWrapper.  Existing configurations with the old useRPackages
will break.
This commit is contained in:
Chris Hodapp
2017-05-01 09:46:40 -04:00
parent e82070382a
commit 29969a5ec7
5 changed files with 52 additions and 47 deletions
+6 -11
View File
@@ -55,28 +55,23 @@ available.
## RStudio
RStudio by default will not use the libraries installed like above.
You must override its R version with your custom R environment, and
set `useRPackages` to `true`, like below:
RStudio uses a standard set of packages and ignores any custom R
environments or installed packages you may have. To create a custom
environment, see `rstudioWrapper`, which functions similarly to
`rWrapper`:
```nix
{
packageOverrides = super: let self = super.pkgs; in
{
rEnv = super.rWrapper.override {
rstudioEnv = super.rstudioWrapper.override {
packages = with self.rPackages; [
devtools
dplyr
ggplot2
reshape2
yaml
optparse
];
};
rstudioEnv = super.rstudio.override {
R = rEnv;
useRPackages = true;
};
};
}
```