about summary refs log tree commit diff
path: root/doc/manual/nix-shell.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/manual/nix-shell.xml')
-rw-r--r--doc/manual/nix-shell.xml22
1 files changed, 15 insertions, 7 deletions
diff --git a/doc/manual/nix-shell.xml b/doc/manual/nix-shell.xml
index 4b369662e2af..8178cea69fe8 100644
--- a/doc/manual/nix-shell.xml
+++ b/doc/manual/nix-shell.xml
@@ -61,11 +61,11 @@ the derivation attribute
 <programlisting>
 shellHook =
   ''
-    echo "Hello shell!"
+    echo "Hello shell"
   '';
 </programlisting>
 
-will cause <command>nix-shell</command> to print <literal>Hello shell!</literal>.</para>
+will cause <command>nix-shell</command> to print <literal>Hello shell</literal>.</para>
 
 </refsection>
 
@@ -132,11 +132,11 @@ interactive shell in which to build it:
 
 <screen>
 $ nix-shell '&lt;nixpkgs>' -A pan
-$ unpackPhase
-$ cd pan-*
-$ configurePhase
-$ buildPhase
-$ ./pan/gui/pan
+[nix-shell]$ unpackPhase
+[nix-shell]$ cd pan-*
+[nix-shell]$ configurePhase
+[nix-shell]$ buildPhase
+[nix-shell]$ ./pan/gui/pan
 </screen>
 
 To clear the environment first, and do some additional automatic
@@ -147,6 +147,14 @@ $ nix-shell '&lt;nixpkgs>' -A pan --pure \
     --command 'export NIX_DEBUG=1; export NIX_CORES=8; return'
 </screen>
 
+Nix expressions can also be given on the command line.  For instance,
+the following starts a shell containing the packages
+<literal>sqlite</literal> and <literal>libX11</literal>:
+
+<screen>
+$ nix-shell -E 'with import &lt;nixpkgs> { }; runCommand "dummy" { buildInputs = [ sqlite xorg.libX11 ]; } ""'
+</screen>
+
 </para>
 
 </refsection>