at 23.05-pre 3.3 kB view raw
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 <refmeta> 5 <refentrytitle><command>nixos-version</command> 6 </refentrytitle><manvolnum>8</manvolnum> 7 <refmiscinfo class="source">NixOS</refmiscinfo> 8 </refmeta> 9 <refnamediv> 10 <refname><command>nixos-version</command></refname> 11 <refpurpose>show the NixOS version</refpurpose> 12 </refnamediv> 13 <refsynopsisdiv> 14 <cmdsynopsis> 15 <command>nixos-version</command> 16 <arg> 17 <option>--hash</option> 18 </arg> 19 20 <arg> 21 <option>--revision</option> 22 </arg> 23 24 <arg> 25 <option>--json</option> 26 </arg> 27 28 </cmdsynopsis> 29 </refsynopsisdiv> 30 31 <refsection> 32 <title>Description</title> 33 <para> 34 This command shows the version of the currently active NixOS configuration. 35 For example: 36<screen><prompt>$ </prompt>nixos-version 3716.03.1011.6317da4 (Emu) 38</screen> 39 The version consists of the following elements: 40 <variablelist> 41 <varlistentry> 42 <term> 43 <literal>16.03</literal> 44 </term> 45 <listitem> 46 <para> 47 The NixOS release, indicating the year and month in which it was 48 released (e.g. March 2016). 49 </para> 50 </listitem> 51 </varlistentry> 52 <varlistentry> 53 <term> 54 <literal>1011</literal> 55 </term> 56 <listitem> 57 <para> 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 63 channel. 64 </para> 65 </listitem> 66 </varlistentry> 67 <varlistentry> 68 <term> 69 <literal>6317da4</literal> 70 </term> 71 <listitem> 72 <para> 73 The first 7 characters of the commit in the Nixpkgs Git repository from 74 which this version was built. 75 </para> 76 </listitem> 77 </varlistentry> 78 <varlistentry> 79 <term> 80 <literal>Emu</literal> 81 </term> 82 <listitem> 83 <para> 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 86 is the fifth release. 87 </para> 88 </listitem> 89 </varlistentry> 90 </variablelist> 91 </para> 92 </refsection> 93 94 <refsection> 95 <title>Options</title> 96 97 <para> 98 This command accepts the following options: 99 </para> 100 101 <variablelist> 102 103 <varlistentry> 104 <term> 105 <option>--hash</option> 106 </term> 107 <term> 108 <option>--revision</option> 109 </term> 110 <listitem> 111 <para> 112 Show the full SHA1 hash of the Git commit from which this configuration 113 was built, e.g. 114<screen><prompt>$ </prompt>nixos-version --hash 1156317da40006f6bc2480c6781999c52d88dde2acf 116</screen> 117 </para> 118 </listitem> 119 </varlistentry> 120 121 <varlistentry> 122 <term> 123 <option>--json</option> 124 </term> 125 <listitem> 126 <para> 127 Print a JSON representation of the versions of NixOS and the 128 top-level configuration flake. 129 </para> 130 </listitem> 131 </varlistentry> 132 133 </variablelist> 134 135 </refsection> 136 137</refentry>