about summary refs log tree commit diff
path: root/pkgs/development/r-modules/README.md
diff options
context:
space:
mode:
authorLangston Barrett <langston.barrett@gmail.com>2016-10-13 22:18:16 +0000
committerLangston Barrett <langston.barrett@gmail.com>2016-10-13 22:18:16 +0000
commit2b300c9befa5f4003e77512efb1b93949a640529 (patch)
treeee8c289579e3817773b38b0638a968fd526e6e7f /pkgs/development/r-modules/README.md
parent13ff831440b7a775f626ceaa47bf663abc83abcd (diff)
r-modules: add more environment documentation
Use nix-shell with a `default.nix` rather than using
config.nix
Diffstat (limited to 'pkgs/development/r-modules/README.md')
-rw-r--r--pkgs/development/r-modules/README.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/pkgs/development/r-modules/README.md b/pkgs/development/r-modules/README.md
index 3a88f45b4ccbb..e384b375460a9 100644
--- a/pkgs/development/r-modules/README.md
+++ b/pkgs/development/r-modules/README.md
@@ -29,6 +29,30 @@ profile. The set of available libraries can be discovered by running the
 command `nix-env -f "<nixpkgs>" -qaP -A rPackages`. The first column from that
 output is the name that has to be passed to rWrapper in the code snipped above.
 
+However, if you'd like to add a file to your project source to make the
+environment available for other contributors, you can create a `default.nix`
+file like so:
+```nix
+let
+  pkgs = import <nixpkgs> {};
+  stdenv = pkgs.stdenv;
+in with pkgs; {
+  myProject = stdenv.mkDerivation {
+    name = "myProject";
+    version = "1";
+    src = if pkgs.lib.inNixShell then null else nix;
+
+    buildInputs = with rPackages; [
+      R
+      ggplot2
+      knitr
+    ];
+  };
+}
+```
+and then run `nix-shell .` to be dropped into a shell with those packages
+available.
+
 ## Updating the package set
 
 ```bash