1 <refentry xmlns="http://docbook.org/ns/docbook"
2 xmlns:xlink="http://www.w3.org/1999/xlink"
3 xmlns:xi="http://www.w3.org/2001/XInclude">
5 <refentrytitle><command>nixos-version</command>
6 </refentrytitle><manvolnum>8</manvolnum>
7 <refmiscinfo class="source">NixOS</refmiscinfo>
10 <refname><command>nixos-version</command></refname>
11 <refpurpose>show the NixOS version</refpurpose>
15 <command>nixos-version</command>
17 <option>--hash</option>
21 <option>--revision</option>
25 <option>--json</option>
32 <title>Description</title>
34 This command shows the version of the currently active NixOS configuration.
36 <screen><prompt>$ </prompt>nixos-version
37 16.03.1011.6317da4 (Emu)
39 The version consists of the following elements:
43 <literal>16.03</literal>
47 The NixOS release, indicating the year and month in which it was
48 released (e.g. March 2016).
54 <literal>1011</literal>
58 The number of commits in the Nixpkgs Git repository between the start of
59 the release branch and the commit from which this version was built.
60 This ensures that NixOS versions are monotonically increasing. It is
61 <literal>git</literal> when the current NixOS configuration was built
62 from a checkout of the Nixpkgs Git repository rather than from a NixOS
69 <literal>6317da4</literal>
73 The first 7 characters of the commit in the Nixpkgs Git repository from
74 which this version was built.
80 <literal>Emu</literal>
84 The code name of the NixOS release. The first letter of the code name
85 indicates that this is the N'th stable NixOS release; for example, Emu
95 <title>Options</title>
98 This command accepts the following options:
105 <option>--hash</option>
108 <option>--revision</option>
112 Show the full SHA1 hash of the Git commit from which this configuration
114 <screen><prompt>$ </prompt>nixos-version --hash
115 6317da40006f6bc2480c6781999c52d88dde2acf
123 <option>--json</option>
127 Print a JSON representation of the versions of NixOS and the
128 top-level configuration flake.