From 36b90e72d7e09b983acfa08f9016e8b3ece5199d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 19 Feb 2014 17:08:01 +0100 Subject: nix-shell: Add --packages flag This allows you to easily set up a build environment containing the specified packages from Nixpkgs. For example: $ nix-shell -p sqlite xorg.libX11 hello will start a shell in which the given packages are present. --- doc/manual/nix-shell.xml | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/manual/nix-shell.xml b/doc/manual/nix-shell.xml index 8178cea69fe8..d5f70a9e66a2 100644 --- a/doc/manual/nix-shell.xml +++ b/doc/manual/nix-shell.xml @@ -18,7 +18,6 @@ nix-shell - name value name value @@ -31,7 +30,16 @@ cmd regexp - path + + + + + + + packages + + path + @@ -114,6 +122,18 @@ also . + / + + Set up an environment in which the specified + packages are present. The command line arguments are interpreted + as attribute names inside the Nix Packages collection. Thus, + nix-shell -p libjpeg openjdk will start a shell + in which the packages denoted by the attribute names + libjpeg and openjdk are + present. + + + The following common options are supported: @@ -155,6 +175,14 @@ the following starts a shell containing the packages $ nix-shell -E 'with import <nixpkgs> { }; runCommand "dummy" { buildInputs = [ sqlite xorg.libX11 ]; } ""' +A shorter way to do the same is: + + +$ nix-shell -p sqlite xorg.libX11 +[nix-shell]$ echo $NIX_LDFLAGS +… -L/nix/store/j1zg5v…-sqlite-3.8.0.2/lib -L/nix/store/0gmcz9…-libX11-1.6.1/lib … + + -- cgit 1.4.1