Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

138 rader
3.2 KiB

  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. <arg>
  20. <option>--revision</option>
  21. </arg>
  22. <arg>
  23. <option>--json</option>
  24. </arg>
  25. </cmdsynopsis>
  26. </refsynopsisdiv>
  27. <refsection>
  28. <title>Description</title>
  29. <para>
  30. This command shows the version of the currently active NixOS configuration.
  31. For example:
  32. <screen><prompt>$ </prompt>nixos-version
  33. 16.03.1011.6317da4 (Emu)
  34. </screen>
  35. The version consists of the following elements:
  36. <variablelist>
  37. <varlistentry>
  38. <term>
  39. <literal>16.03</literal>
  40. </term>
  41. <listitem>
  42. <para>
  43. The NixOS release, indicating the year and month in which it was
  44. released (e.g. March 2016).
  45. </para>
  46. </listitem>
  47. </varlistentry>
  48. <varlistentry>
  49. <term>
  50. <literal>1011</literal>
  51. </term>
  52. <listitem>
  53. <para>
  54. The number of commits in the Nixpkgs Git repository between the start of
  55. the release branch and the commit from which this version was built.
  56. This ensures that NixOS versions are monotonically increasing. It is
  57. <literal>git</literal> when the current NixOS configuration was built
  58. from a checkout of the Nixpkgs Git repository rather than from a NixOS
  59. channel.
  60. </para>
  61. </listitem>
  62. </varlistentry>
  63. <varlistentry>
  64. <term>
  65. <literal>6317da4</literal>
  66. </term>
  67. <listitem>
  68. <para>
  69. The first 7 characters of the commit in the Nixpkgs Git repository from
  70. which this version was built.
  71. </para>
  72. </listitem>
  73. </varlistentry>
  74. <varlistentry>
  75. <term>
  76. <literal>Emu</literal>
  77. </term>
  78. <listitem>
  79. <para>
  80. The code name of the NixOS release. The first letter of the code name
  81. indicates that this is the N'th stable NixOS release; for example, Emu
  82. is the fifth release.
  83. </para>
  84. </listitem>
  85. </varlistentry>
  86. </variablelist>
  87. </para>
  88. </refsection>
  89. <refsection>
  90. <title>Options</title>
  91. <para>
  92. This command accepts the following options:
  93. </para>
  94. <variablelist>
  95. <varlistentry>
  96. <term>
  97. <option>--hash</option>
  98. </term>
  99. <term>
  100. <option>--revision</option>
  101. </term>
  102. <listitem>
  103. <para>
  104. Show the full SHA1 hash of the Git commit from which this configuration
  105. was built, e.g.
  106. <screen><prompt>$ </prompt>nixos-version --hash
  107. 6317da40006f6bc2480c6781999c52d88dde2acf
  108. </screen>
  109. </para>
  110. </listitem>
  111. </varlistentry>
  112. <varlistentry>
  113. <term>
  114. <option>--json</option>
  115. </term>
  116. <listitem>
  117. <para>
  118. Print a JSON representation of the versions of NixOS and the
  119. top-level configuration flake.
  120. </para>
  121. </listitem>
  122. </varlistentry>
  123. </variablelist>
  124. </refsection>
  125. </refentry>