diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-02-19 16:30:19 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-02-19 16:30:19 +0100 |
commit | c31836008e45460513188a3fbeda4416f9153a05 (patch) | |
tree | b062ecb0979116fbc4cc0db76cba8c03a453b140 /doc/manual/nix-shell.xml | |
parent | e707a8a526698de2237e6ac89e2f1ce6dbc63269 (diff) |
nix-instantiate: Add a flag --expr / -E to read expressions from the command line
This is basically a shortcut for ‘echo 'expr...' | nix-instantiate -’.
Also supported by nix-build and nix-shell.
Diffstat (limited to 'doc/manual/nix-shell.xml')
-rw-r--r-- | doc/manual/nix-shell.xml | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/doc/manual/nix-shell.xml b/doc/manual/nix-shell.xml index 4b369662e..8178cea69 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 '<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 '<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 <nixpkgs> { }; runCommand "dummy" { buildInputs = [ sqlite xorg.libX11 ]; } ""' +</screen> + </para> </refsection> |