From 42b70ae5edccac2c6ca2afb205ace21790850919 Mon Sep 17 00:00:00 2001 From: Maciej Kazulak Date: Fri, 3 Nov 2017 15:15:01 +0100 Subject: [PATCH] nixpkgs manual: add rstudio shell.nix example Provide an example of a self-contained shell.nix for rstudio with additional packages. --- pkgs/development/r-modules/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkgs/development/r-modules/README.md b/pkgs/development/r-modules/README.md index 477059cbb2c8..c8f02bd14780 100644 --- a/pkgs/development/r-modules/README.md +++ b/pkgs/development/r-modules/README.md @@ -79,6 +79,23 @@ environment, see `rstudioWrapper`, which functions similarly to Then like above, `nix-env -f "" -iA rstudioEnv` will install this into your user profile. +Alternatively, you can create a self-contained `shell.nix` without the need to +modify any configuration files: + +```nix +{ pkgs ? import {} +}: + +pkgs.rstudioWrapper.override { + packages = with pkgs.rPackages; [ dplyr ggplot2 reshape2 ]; +} + +``` + +Executing `nix-shell` will then drop you into an environment equivalent to the +one above. If you need additional packages just add them to the list and +re-enter the shell. + ## Updating the package set ```bash