nixos-version(8)

NAME
nixos-version - show the NixOS version

SYNOPSIS
nixos-version [--hash] [--revision] [--configuration-revision] [--json]

DESCRIPTION
This command shows the version of the currently active NixOS configuration. For example:

    $ nixos-version
    16.03.1011.6317da4 (Emu)

The version consists of the following elements:

‘16.03’
    The NixOS release, indicating the year and month in which it was released (e.g. March 2016).

‘1011’
    The number of commits in the Nixpkgs Git repository between the start of the release branch and the commit from which this version was built. This ensures that NixOS versions are monotonically increasing. It is ‘git’ when the current NixOS configuration was built from a checkout of the Nixpkgs Git repository rather than from a NixOS channel.

‘6317da4’
    The first 7 characters of the commit in the Nixpkgs Git repository from which this version was built.

‘Emu’
    The code name of the NixOS release. The first letter of the code name indicates that this is the N'th stable NixOS release; for example, Emu is the fifth release.

OPTIONS

--hash, --revision
    Show the full SHA1 hash of the Git commit from which this configuration was built, e.g.

        $ nixos-version --hash
        6317da40006f6bc2480c6781999c52d88dde2acf

--configuration-revision
    Show the configuration revision if available. This could be the full SHA1 hash of the Git commit of the system flake, if you add

        { system.configurationRevision = self.rev or "dirty"; }

    to the ‘modules’ array of your flake.nix system configuration e.g.

        $ nixos-version --configuration-revision
        aa314ebd1592f6cdd53cb5bba8bcae97d9323de8

--json
    Print a JSON representation of the versions of NixOS and the top-level configuration flake.

AUTHORS
-nosplit Eelco Dolstra and the Nixpkgs/NixOS contributors