diff options
Diffstat (limited to 'doc/manual/src/command-ref/nix-build.md')
-rw-r--r-- | doc/manual/src/command-ref/nix-build.md | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/doc/manual/src/command-ref/nix-build.md b/doc/manual/src/command-ref/nix-build.md index 44de4cf53..b548edf82 100644 --- a/doc/manual/src/command-ref/nix-build.md +++ b/doc/manual/src/command-ref/nix-build.md @@ -51,8 +51,9 @@ derivation). # Options -All options not listed here are passed to `nix-store --realise`, -except for `--arg` and `--attr` / `-A` which are passed to `nix-instantiate`. +All options not listed here are passed to +[`nix-store --realise`](nix-store/realise.md), +except for `--arg` and `--attr` / `-A` which are passed to [`nix-instantiate`](nix-instantiate.md). - <span id="opt-no-out-link">[`--no-out-link`](#opt-no-out-link)<span> @@ -69,6 +70,8 @@ except for `--arg` and `--attr` / `-A` which are passed to `nix-instantiate`. Change the name of the symlink to the output path created from `result` to *outlink*. +{{#include ./status-build-failure.md}} + {{#include ./opt-common.md}} {{#include ./env-common.md}} @@ -76,7 +79,7 @@ except for `--arg` and `--attr` / `-A` which are passed to `nix-instantiate`. # Examples ```console -$ nix-build '<nixpkgs>' -A firefox +$ nix-build '<nixpkgs>' --attr firefox store derivation is /nix/store/qybprl8sz2lc...-firefox-1.5.0.7.drv /nix/store/d18hyl92g30l...-firefox-1.5.0.7 @@ -91,7 +94,7 @@ If a derivation has multiple outputs, `nix-build` will build the default (first) output. You can also build all outputs: ```console -$ nix-build '<nixpkgs>' -A openssl.all +$ nix-build '<nixpkgs>' --attr openssl.all ``` This will create a symlink for each output named `result-outputname`. @@ -101,7 +104,7 @@ outputs `out`, `bin` and `man`, `nix-build` will create symlinks specific output: ```console -$ nix-build '<nixpkgs>' -A openssl.man +$ nix-build '<nixpkgs>' --attr openssl.man ``` This will create a symlink `result-man`. @@ -109,7 +112,7 @@ This will create a symlink `result-man`. Build a Nix expression given on the command line: ```console -$ nix-build -E 'with import <nixpkgs> { }; runCommand "foo" { } "echo bar > $out"' +$ nix-build --expr 'with import <nixpkgs> { }; runCommand "foo" { } "echo bar > $out"' $ cat ./result bar ``` @@ -118,5 +121,5 @@ Build the GNU Hello package from the latest revision of the master branch of Nixpkgs: ```console -$ nix-build https://github.com/NixOS/nixpkgs/archive/master.tar.gz -A hello +$ nix-build https://github.com/NixOS/nixpkgs/archive/master.tar.gz --attr hello ``` |