summary refs log tree commit diff
path: root/nixos/doc/manual/man-nixos-version.xml
blob: aada08c5b4a97526f045e438bf65d80439a8213c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<refentry xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:xi="http://www.w3.org/2001/XInclude">
 <refmeta>
  <refentrytitle><command>nixos-version</command>
  </refentrytitle><manvolnum>8</manvolnum>
  <refmiscinfo class="source">NixOS</refmiscinfo>
 </refmeta>
 <refnamediv>
  <refname><command>nixos-version</command></refname>
  <refpurpose>show the NixOS version</refpurpose>
 </refnamediv>
 <refsynopsisdiv>
  <cmdsynopsis>
   <command>nixos-version</command>
   <arg>
    <option>--hash</option>
   </arg>

   <arg>
    <option>--revision</option>
   </arg>

   <arg>
    <option>--json</option>
   </arg>

  </cmdsynopsis>
 </refsynopsisdiv>

 <refsection>
  <title>Description</title>
  <para>
   This command shows the version of the currently active NixOS configuration.
   For example:
<screen>$ nixos-version
16.03.1011.6317da4 (Emu)
</screen>
   The version consists of the following elements:
   <variablelist>
    <varlistentry>
     <term>
      <literal>16.03</literal>
     </term>
     <listitem>
      <para>
       The NixOS release, indicating the year and month in which it was
       released (e.g. March 2016).
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term>
      <literal>1011</literal>
     </term>
     <listitem>
      <para>
       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
       <literal>git</literal> when the current NixOS configuration was built
       from a checkout of the Nixpkgs Git repository rather than from a NixOS
       channel.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term>
      <literal>6317da4</literal>
     </term>
     <listitem>
      <para>
       The first 7 characters of the commit in the Nixpkgs Git repository from
       which this version was built.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term>
      <literal>Emu</literal>
     </term>
     <listitem>
      <para>
       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.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsection>

 <refsection>
  <title>Options</title>

  <para>
   This command accepts the following options:
  </para>

  <variablelist>

   <varlistentry>
    <term>
     <option>--hash</option>
    </term>
    <term>
     <option>--revision</option>
    </term>
    <listitem>
     <para>
      Show the full SHA1 hash of the Git commit from which this configuration
      was built, e.g.
<screen>$ nixos-version --hash
6317da40006f6bc2480c6781999c52d88dde2acf
</screen>
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term>
     <option>--json</option>
    </term>
    <listitem>
     <para>
      Print a JSON representation of the versions of NixOS and the
      top-level configuration flake.
     </para>
    </listitem>
   </varlistentry>

  </variablelist>

 </refsection>

</refentry>