···1011<refnamediv>
12 <refname><command>nixos-version</command></refname>
13- <refpurpose>show the version of nixpkgs NixOS was built from</refpurpose>
14</refnamediv>
1516<refsynopsisdiv>
···2324<refsection><title>Description</title>
2526-<para>This command describes the version of nixpkgs used to build
27-NixOS.</para>
2829-<para>By default the output includes:</para>
00003031-<itemizedlist>
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>
36-</itemizedlist>
37-</refsection>
3839-<refsection><title>Example</title>
0000000000000000000000000000004041-<para>Here is an example output, and corresponding information:
42-<screen>$ nixos-version
43-16.03.1011.6317da4 (Emu)
44-</screen>
45-</para>
4647-<informaltable>
48- <tgroup cols="2">
49- <thead>
50- <row>
51- <entry>Attribute</entry>
52- <entry>Value</entry>
53- </row>
54- </thead>
55- <tbody>
56- <row>
57- <entry>NixOS Release</entry>
58- <entry><literal>16.03</literal></entry>
59- </row>
60- <row>
61- <entry>Commit Count</entry>
62- <entry><literal>1011</literal></entry>
63- </row>
64- <row>
65- <entry>Commit SHA</entry>
66- <entry><literal>6317da4</literal></entry>
67- </row>
68- <row>
69- <entry>Release Codename</entry>
70- <entry><literal>Emu</literal></entry>
71- </row>
72- </tbody>
73- </tgroup>
74-</informaltable>
75-<para>
76</para>
77-7879</refsection>
80···89 <term><option>--hash</option></term>
90 <term><option>--revision</option></term>
91 <listitem>
92- <para>The output will be the full hash of the git commit
093<screen>$ nixos-version --hash
946317da40006f6bc2480c6781999c52d88dde2acf
95</screen>
···1011<refnamediv>
12 <refname><command>nixos-version</command></refname>
13+ <refpurpose>show the NixOS version</refpurpose>
14</refnamediv>
1516<refsynopsisdiv>
···2324<refsection><title>Description</title>
2526+<para>This command shows the version of the currently active NixOS
27+configuration. For example:
2829+<screen>$ nixos-version
30+16.03.1011.6317da4 (Emu)
31+</screen>
32+33+The version consists of the following elements:
3435+<variablelist>
0000003637+ <varlistentry>
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>
41+ </varlistentry>
42+43+ <varlistentry>
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>
52+ </varlistentry>
53+54+ <varlistentry>
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>
59+ </varlistentry>
60+61+ <varlistentry>
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>
67+ </varlistentry>
6869+</variablelist>
0000700000000000000000000000000000071</para>
07273</refsection>
74···83 <term><option>--hash</option></term>
84 <term><option>--revision</option></term>
85 <listitem>
86+ <para>Show the full SHA1 hash of the Git commit from which this
87+ configuration was built, e.g.
88<screen>$ nixos-version --hash
896317da40006f6bc2480c6781999c52d88dde2acf
90</screen>