summary refs log tree commit diff
path: root/doc/language-support.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/language-support.xml')
-rw-r--r--doc/language-support.xml21
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/language-support.xml b/doc/language-support.xml
index 9117af864add..a969111ed77c 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