diff options
author | Nikolay Amiantov <ab@fmap.me> | 2015-08-14 14:06:15 +0300 |
---|---|---|
committer | Nikolay Amiantov <ab@fmap.me> | 2015-08-17 21:22:50 +0300 |
commit | 344e5221664a8c232c3b2b0c7667dcd4c229834f (patch) | |
tree | d1254cf1dd7fdd512fa716fec5e0431c4980996e /doc | |
parent | 0ccf8eae2fde05fe196c39f0c7b7b70af8752a28 (diff) |
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 |