nix-instantiateinstantiate store derivations from Nix expressionsnix-instantiatenamevalueattrPathpathfilesDescriptionThe command nix-instantiate generates store derivations from (high-level)
Nix expressions. It loads and evaluates the Nix expressions in each
of files. Each top-level expression should
evaluate to a derivation, a list of derivations, or a set of
derivations. The paths of the resulting store derivations are printed
on standard output.If files is the character
-, then a Nix expression will be read from standard
input.Most users and developers don’t need to use this command
(nix-env and nix-build perform
store derivation instantiation from Nix expressions automatically).
It is most commonly used for implementing new deployment
policies.See also for a list of
common options.OptionspathSee the corresponding
options in nix-store.Just parse the input files, and print their
abstract syntax trees on standard output in ATerm
format.Just parse and evaluate the input files, and print
the resulting values on standard output. No instantiation of
store derivations takes place.Examples
$ nix-instantiate test.nix (instantiate)
/nix/store/cigxbmvy6dzix98dxxh9b6shg7ar5bvs-perl-BerkeleyDB-0.26.drv
$ nix-store -r $(nix-instantiate test.nix) (build)...
/nix/store/qhqk4n8ci095g3sdp93x7rgwyh9rdvgk-perl-BerkeleyDB-0.26 (output path)
$ ls -l /nix/store/qhqk4n8ci095g3sdp93x7rgwyh9rdvgk-perl-BerkeleyDB-0.26
dr-xr-xr-x 2 eelco users 4096 1970-01-01 01:00 lib
...