R""(
Evaluate a Nix expression given on the command line:
Evaluate a Nix expression to JSON:
Evaluate a Nix expression from a file:
Get the current version of the nixpkgs
flake:
Print the store path of the Hello package:
Get a list of checks in the nix
flake:
Generate a directory with the specified contents:
``‘console
bar
123
This command evaluates the given Nix expression, and prints the result on standard output.
It also evaluates any nested attribute values and list items.
nix eval
can produce output in several formats:
--json
, the evaluation result is printed in JSON format. Note that this fails if the result contains values that are not representable as JSON, such as functions.--raw
, the evaluation result must be a string, which is printed verbatim, without any quoting.--write-to
path, the evaluation result must be a string or a nested attribute set whose leaf values are strings. These strings are written to files named path/*attrpath*. path must not already exist.)""