···
<refname><command>nixos-version</command></refname>
13
-
<refpurpose>show the version of nixpkgs NixOS was built from</refpurpose>
13
+
<refpurpose>show the NixOS version</refpurpose>
···
<refsection><title>Description</title>
26
-
<para>This command describes the version of nixpkgs used to build
26
+
<para>This command shows the version of the currently active NixOS
27
+
configuration. For example:
29
-
<para>By default the output includes:</para>
29
+
<screen>$ nixos-version
30
+
16.03.1011.6317da4 (Emu)
33
+
The version consists of the following elements:
32
-
<listitem><para>The NixOS release</para></listitem>
33
-
<listitem><para>Number of commits since the release</para></listitem>
34
-
<listitem><para>Git SHA of the released commit</para></listitem>
35
-
<listitem><para>Codename of the NixOS release</para></listitem>
39
-
<refsection><title>Example</title>
38
+
<term><literal>16.03</literal></term>
39
+
<listitem><para>The NixOS release, indicating the year and month
40
+
in which it was released (e.g. March 2016).</para></listitem>
44
+
<term><literal>1011</literal></term>
45
+
<listitem><para>The number of commits in the Nixpkgs Git
46
+
repository between the start of the release branch and the commit
47
+
from which this version was built. This ensures that NixOS
48
+
versions are monotonically increasing. It is
49
+
<literal>git</literal> when the current NixOS configuration was
50
+
built from a checkout of the Nixpkgs Git repository rather than
51
+
from a NixOS channel.</para></listitem>
55
+
<term><literal>6317da4</literal></term>
56
+
<listitem><para>The first 7 characters of the commit in the
57
+
Nixpkgs Git repository from which this version was
58
+
built.</para></listitem>
62
+
<term><literal>Emu</literal></term>
63
+
<listitem><para>The code name of the NixOS release. The first
64
+
letter of the code name indicates that this is the N'th stable
65
+
NixOS release; for example, Emu is the fifth
66
+
release.</para></listitem>
41
-
<para>Here is an example output, and corresponding information:
42
-
<screen>$ nixos-version
43
-
16.03.1011.6317da4 (Emu)
51
-
<entry>Attribute</entry>
52
-
<entry>Value</entry>
57
-
<entry>NixOS Release</entry>
58
-
<entry><literal>16.03</literal></entry>
61
-
<entry>Commit Count</entry>
62
-
<entry><literal>1011</literal></entry>
65
-
<entry>Commit SHA</entry>
66
-
<entry><literal>6317da4</literal></entry>
69
-
<entry>Release Codename</entry>
70
-
<entry><literal>Emu</literal></entry>
···
<term><option>--hash</option></term>
<term><option>--revision</option></term>
92
-
<para>The output will be the full hash of the git commit
86
+
<para>Show the full SHA1 hash of the Git commit from which this
87
+
configuration was built, e.g.
<screen>$ nixos-version --hash
6317da40006f6bc2480c6781999c52d88dde2acf