doc/manual/source/command-ref/nix-store/realise.md
nix-store --realise - build or fetch store objects
nix-store {--realise | -r} paths… [--dry-run]
Each of paths is processed as follows:
builder executable
<!-- TODO: Link to build process page #8888 -->
If no substitutes are available and no store derivation is given, realisation fails.
The resulting paths are printed on standard output. For non-derivation arguments, the argument itself is printed.
{{#include ../status-build-failure.md}}
--dry-run
Print on standard error a description of what packages would be built or downloaded, without actually performing the operation.
--ignore-unknown
If a non-derivation path does not have a substitute, then silently ignore it.
--check
This option allows you to check whether a derivation is
deterministic. It rebuilds the specified derivation and checks
whether the result is bitwise-identical with the existing outputs,
printing an error if that’s not the case. The outputs of the
specified derivation must already exist. When used with -K, if an
output path is not identical to the corresponding output from the
previous build, the new output path is left in
/nix/store/name.check.
{{#include ./opt-common.md}}
{{#include ../opt-common.md}}
{{#include ../env-common.md}}
This operation is typically used to build store derivations produced by
nix-instantiate:
$ nix-store --realise $(nix-instantiate ./test.nix)
/nix/store/6gwmy5jcnwdlz6aqqhksz863f1l8xc2w-aterm-2.3.1
This is essentially what nix-build does.
To test whether a previously-built derivation is deterministic:
$ nix-build '<nixpkgs>' --attr hello --check -K
Use nix-store --read-log to show the stderr and stdout of a build:
$ nix-store --read-log $(nix-instantiate ./test.nix)