git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #19533 from siddharthist/r-modules/readme-nix-shell
fe518a7Jörg Thalheim
pkgs/development/r-modules/README.md+24
@@ -29,6 +29,30 @@ profile. The set of available libraries can be discovered by running the
29command `nix-env -f "<nixpkgs>" -qaP -A rPackages`. The first column from that
29command `nix-env -f "<nixpkgs>" -qaP -A rPackages`. The first column from that
30output is the name that has to be passed to rWrapper in the code snipped above.
30output is the name that has to be passed to rWrapper in the code snipped above.
31
31
32+However, if you'd like to add a file to your project source to make the
33+environment available for other contributors, you can create a `default.nix`
34+file like so:
35+```nix
36+let
37+ pkgs = import <nixpkgs> {};
38+ stdenv = pkgs.stdenv;
39+in with pkgs; {
40+ myProject = stdenv.mkDerivation {
41+ name = "myProject";
42+ version = "1";
43+ src = if pkgs.lib.inNixShell then null else nix;
44+
45+ buildInputs = with rPackages; [
46+ R
47+ ggplot2
48+ knitr
49+ ];
50+ };
51+}
52+```
53+and then run `nix-shell .` to be dropped into a shell with those packages
54+available.
55+
32## Updating the package set
56## Updating the package set
33
57
34```bash
58```bash