Warning
This program is experimental and its interface is subject to change.
Name
nix version - show the Nix version
Synopsis
nix version [option…]
Examples
-
Show the Nix version:
# nix version nix (Nix) X.Y.Z -
Show the version together with the versions of the libraries Nix links against, as machine-readable JSON:
# nix version --json { "version": "X.Y.Z", "libraries": { "libcurl": "P.Q.R", "libgit2": "A.B.C" } }
Description
Print the version of Nix.
Without any flags, this is like the nix --version
option.
This subcommand additionally reports the versions of the libraries Nix links against (see --json below).
With --json, the output is a JSON object with the following fields:
-
version: The version of Nix, as also printed bynix --version. -
libraries: An object mapping the names of Nix’s direct third-party dependencies to their versions. Which entries appear here depends on how Nix was built, so consumers should not assume any particular key is present.For a library that exposes its version at runtime, this is the version of the loaded library, which on some platforms may differ from the version Nix was compiled against. For dependencies without such a query, it is the version Nix was compiled with.
This list covers direct dependencies only; transitive dependencies are not included.
Options
-
Produce output in JSON format, suitable for consumption by another program.
-
Print compact JSON output on a single line, even when the output is a terminal. Some commands may print multiple JSON objects on separate lines.
See `--pretty`. -
Print multi-line, indented JSON output for readability.
Default: indent if output is to a terminal. This option is only effective when `--json` is also specified.
Logging-related options
-
Set the logging verbosity level to ‘debug’.
-
--log-formatformatSet the format of log output; one of
raw,internal-json,barorbar-with-logs. -
--print-build-logs/-LPrint full build logs on standard error.
-
Decrease the logging verbosity level.
-
--verbose/-vIncrease the logging verbosity level.
Miscellaneous global options
-
Show usage information.
-
Disable substituters and consider all previously downloaded files up-to-date.
-
--optionname valueSet the Nix configuration setting name to value (overriding
nix.conf). -
Consider all previously downloaded files out-of-date.
-
Show version information.
Note
See
man nix.conffor overriding configuration settings with command line flags.