Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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 by nix --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

  • --json

    Produce output in JSON format, suitable for consumption by another program.

  • --no-pretty

    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`.
    
  • --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.
    
  • --debug

    Set the logging verbosity level to ‘debug’.

  • --log-format format

    Set the format of log output; one of raw, internal-json, bar or bar-with-logs.

  • --print-build-logs / -L

    Print full build logs on standard error.

  • --quiet

    Decrease the logging verbosity level.

  • --verbose / -v

    Increase the logging verbosity level.

Miscellaneous global options

  • --help

    Show usage information.

  • --offline

    Disable substituters and consider all previously downloaded files up-to-date.

  • --option name value

    Set the Nix configuration setting name to value (overriding nix.conf).

  • --refresh

    Consider all previously downloaded files out-of-date.

  • --version

    Show version information.

Note

See man nix.conf for overriding configuration settings with command line flags.