diff options
author | Domen Kožar <domen@dev.si> | 2015-08-18 13:09:04 +0200 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2015-08-18 13:09:04 +0200 |
commit | f044c311748a6e4938f8b9b8bcaba85ef6d22fe7 (patch) | |
tree | 0901dce26156db560c054b8e855ad79cbb14226d /doc | |
parent | 3409dc7fe820aca231caa5058ef7448af0046984 (diff) | |
parent | 344e5221664a8c232c3b2b0c7667dcd4c229834f (diff) |
Merge pull request #9298 from abbradar/python-env
python: add .env for convenient nix-shell's
Diffstat (limited to 'doc')
-rw-r--r-- | doc/language-support.xml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/language-support.xml b/doc/language-support.xml index 9117af864add6..a969111ed77c3 100644 --- a/doc/language-support.xml +++ b/doc/language-support.xml @@ -464,6 +464,27 @@ python.buildEnv.override { with wrapped binaries in <filename>bin/</filename>. </para> + <para> + You can also use <varname>env</varname> attribute to create local + environments with needed packages installed (somewhat comparable to + <literal>virtualenv</literal>). For example, with the following + <filename>shell.nix</filename>: + +<programlisting language="nix"> +<![CDATA[with import <nixpkgs> {}; + +(python3.buildEnv.override { + extraLibs = with python3Packages; + [ numpy + requests + ]; +}).env]]> +</programlisting> + + Running <command>nix-shell</command> will drop you into a shell where + <command>python</command> will have specified packages in its path. + </para> + <variablelist> <title> <function>python.buildEnv</function> arguments |