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">
4
5<refmeta>
6 <refentrytitle><command>nixos-version</command></refentrytitle>
7 <manvolnum>8</manvolnum>
8 <refmiscinfo class="source">NixOS</refmiscinfo>
9</refmeta>
10
11<refnamediv>
12 <refname><command>nixos-version</command></refname>
13 <refpurpose>show the NixOS version</refpurpose>
14</refnamediv>
15
16<refsynopsisdiv>
17 <cmdsynopsis>
18 <command>nixos-version</command>
19 <arg><option>--hash</option></arg>
20 <arg><option>--revision</option></arg>
21 </cmdsynopsis>
22</refsynopsisdiv>
23
24<refsection><title>Description</title>
25
26<para>This command shows the version of the currently active NixOS
27configuration. For example:
28
29<screen>$ nixos-version
3016.03.1011.6317da4 (Emu)
31</screen>
32
33The version consists of the following elements:
34
35<variablelist>
36
37 <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>
68
69</variablelist>
70
71</para>
72
73</refsection>
74
75
76<refsection><title>Options</title>
77
78<para>This command accepts the following options:</para>
79
80<variablelist>
81
82 <varlistentry>
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>
91 </para>
92 </listitem>
93 </varlistentry>
94</variablelist>
95
96</refsection>
97</refentry>