git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #31192 from mulderr/master

nixpkgs manual: add rstudio shell.nix example

commit37d5539aeb10973aba9c84f5214625c85e9c39b4 authorPeter Simons <simons@cryp.to> dateSun 5 Nov 2017, 09:48 (9 years ago) parentdd851a842b70ae
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