git.iko.soy/typeable/nixpkgs
on master help sign in
nixpkgs manual: add rstudio shell.nix example

Provide an example of a self-contained shell.nix for rstudio with additional packages.

commit42b70ae5edccac2c6ca2afb205ace21790850919 authorMaciej Kazulak <kazulakm@gmail.com> dateFri 3 Nov 2017, 15:15 (9 years ago) parent9a15344
1 file changed+17
pkgs/development/r-modules/README.md+17
pkgs/development/r-modules/README.md+17
@@ -79,6 +79,23 @@ environment, see `rstudioWrapper`, which functions similarly to
7979Then like above, `nix-env -f "<nixpkgs>" -iA rstudioEnv` will install
8080this into your user profile.
8181
82+Alternatively, you can create a self-contained `shell.nix` without the need to
83+modify any configuration files:
84+
85+```nix
86+{ pkgs ? import <nixpkgs> {}
87+}:
88+
89+pkgs.rstudioWrapper.override {
90+ packages = with pkgs.rPackages; [ dplyr ggplot2 reshape2 ];
91+}
92+
93+```
94+
95+Executing `nix-shell` will then drop you into an environment equivalent to the
96+one above. If you need additional packages just add them to the list and
97+re-enter the shell.
98+
8299## Updating the package set
83100
84101```bash