git.iko.soy/typeable/nixpkgs
on master help sign in
r-modules: add more environment documentation

Use nix-shell with a `default.nix` rather than using config.nix

commit2b300c9befa5f4003e77512efb1b93949a640529 authorLangston Barrett <langston.barrett@gmail.com> dateThu 13 Oct 2016, 22:18 (10 years ago) parent13ff831
1 file changed+24
pkgs/development/r-modules/README.md+24
pkgs/development/r-modules/README.md+24
@@ -29,6 +29,30 @@ profile. The set of available libraries can be discovered by running the
2929command `nix-env -f "<nixpkgs>" -qaP -A rPackages`. The first column from that
3030output is the name that has to be passed to rWrapper in the code snipped above.
3131
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+
3256## Updating the package set
3357
3458```bash