doc: add man page for nixos-version (#16869)

authored by Graham Christensen and committed by Domen Kožar d9724bcd 3df7f3cb

+106
+102
nixos/doc/manual/man-nixos-version.xml
···
··· 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 version of nixpkgs NixOS was built from</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 describes the version of nixpkgs used to build 27 + NixOS.</para> 28 + 29 + <para>By default the output includes:</para> 30 + 31 + <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> 38 + 39 + <refsection><title>Example</title> 40 + 41 + <para>Here is an example output, and corresponding information: 42 + <screen>$ nixos-version 43 + 16.03.1011.6317da4 (Emu) 44 + </screen> 45 + </para> 46 + 47 + <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 + 78 + 79 + </refsection> 80 + 81 + 82 + <refsection><title>Options</title> 83 + 84 + <para>This command accepts the following options:</para> 85 + 86 + <variablelist> 87 + 88 + <varlistentry> 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 93 + <screen>$ nixos-version --hash 94 + 6317da40006f6bc2480c6781999c52d88dde2acf 95 + </screen> 96 + </para> 97 + </listitem> 98 + </varlistentry> 99 + </variablelist> 100 + 101 + </refsection> 102 + </refentry>
+1
nixos/doc/manual/man-pages.xml
··· 27 <xi:include href="man-nixos-install.xml" /> 28 <xi:include href="man-nixos-option.xml" /> 29 <xi:include href="man-nixos-rebuild.xml" /> 30 31 </reference>
··· 27 <xi:include href="man-nixos-install.xml" /> 28 <xi:include href="man-nixos-option.xml" /> 29 <xi:include href="man-nixos-rebuild.xml" /> 30 + <xi:include href="man-nixos-version.xml" /> 31 32 </reference>
+3
nixos/modules/installer/tools/nixos-version.sh
··· 1 #! @shell@ 2 3 case "$1" in 4 --hash|--revision) 5 echo "@nixosRevision@" 6 ;;
··· 1 #! @shell@ 2 3 case "$1" in 4 + --help) 5 + exec man nixos-version 6 + exit 1 7 --hash|--revision) 8 echo "@nixosRevision@" 9 ;;