You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

man-nixos-enter.xml 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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-enter</command>
  6. </refentrytitle><manvolnum>8</manvolnum>
  7. <refmiscinfo class="source">NixOS</refmiscinfo>
  8. <!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo> -->
  9. </refmeta>
  10. <refnamediv>
  11. <refname><command>nixos-enter</command></refname>
  12. <refpurpose>run a command in a NixOS chroot environment</refpurpose>
  13. </refnamediv>
  14. <refsynopsisdiv>
  15. <cmdsynopsis>
  16. <command>nixos-enter</command>
  17. <arg>
  18. <arg choice='plain'>
  19. <option>--root</option>
  20. </arg>
  21. <replaceable>root</replaceable>
  22. </arg>
  23. <arg>
  24. <arg choice='plain'>
  25. <option>--system</option>
  26. </arg>
  27. <replaceable>system</replaceable>
  28. </arg>
  29. <arg>
  30. <arg choice='plain'>
  31. <option>-c</option>
  32. </arg>
  33. <replaceable>shell-command</replaceable>
  34. </arg>
  35. <arg>
  36. <arg choice='plain'>
  37. <option>--silent</option>
  38. </arg>
  39. </arg>
  40. <arg>
  41. <arg choice='plain'>
  42. <option>--help</option>
  43. </arg>
  44. </arg>
  45. <arg>
  46. <arg choice='plain'>
  47. <option>--</option>
  48. </arg>
  49. <replaceable>arguments</replaceable>
  50. </arg>
  51. </cmdsynopsis>
  52. </refsynopsisdiv>
  53. <refsection>
  54. <title>Description</title>
  55. <para>
  56. This command runs a command in a NixOS chroot environment, that is, in a
  57. filesystem hierarchy previously prepared using
  58. <command>nixos-install</command>.
  59. </para>
  60. </refsection>
  61. <refsection>
  62. <title>Options</title>
  63. <para>
  64. This command accepts the following options:
  65. </para>
  66. <variablelist>
  67. <varlistentry>
  68. <term>
  69. <option>--root</option>
  70. </term>
  71. <listitem>
  72. <para>
  73. The path to the NixOS system you want to enter. It defaults to
  74. <filename>/mnt</filename>.
  75. </para>
  76. </listitem>
  77. </varlistentry>
  78. <varlistentry>
  79. <term>
  80. <option>--system</option>
  81. </term>
  82. <listitem>
  83. <para>
  84. The NixOS system configuration to use. It defaults to
  85. <filename>/nix/var/nix/profiles/system</filename>. You can enter a
  86. previous NixOS configuration by specifying a path such as
  87. <filename>/nix/var/nix/profiles/system-106-link</filename>.
  88. </para>
  89. </listitem>
  90. </varlistentry>
  91. <varlistentry>
  92. <term>
  93. <option>--command</option>
  94. </term>
  95. <term>
  96. <option>-c</option>
  97. </term>
  98. <listitem>
  99. <para>
  100. The bash command to execute.
  101. </para>
  102. </listitem>
  103. </varlistentry>
  104. <varlistentry>
  105. <term>
  106. <option>--silent</option>
  107. </term>
  108. <listitem>
  109. <para>
  110. Suppresses all output from the activation script of the target system.
  111. </para>
  112. </listitem>
  113. </varlistentry>
  114. <varlistentry>
  115. <term>
  116. <option>--</option>
  117. </term>
  118. <listitem>
  119. <para>
  120. Interpret the remaining arguments as the program name and arguments to be
  121. invoked. The program is not executed in a shell.
  122. </para>
  123. </listitem>
  124. </varlistentry>
  125. </variablelist>
  126. </refsection>
  127. <refsection>
  128. <title>Examples</title>
  129. <para>
  130. Start an interactive shell in the NixOS installation in
  131. <filename>/mnt</filename>:
  132. </para>
  133. <screen>
  134. # nixos-enter /mnt
  135. </screen>
  136. <para>
  137. Run a shell command:
  138. </para>
  139. <screen>
  140. # nixos-enter -c 'ls -l /; cat /proc/mounts'
  141. </screen>
  142. <para>
  143. Run a non-shell command:
  144. </para>
  145. <screen>
  146. # nixos-enter -- cat /proc/mounts
  147. </screen>
  148. </refsection>
  149. </refentry>