2018-02-05 18:41:54 +00:00
|
|
|
<refentry xmlns="http://docbook.org/ns/docbook"
|
|
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
|
|
xmlns:xi="http://www.w3.org/2001/XInclude">
|
2018-05-02 00:57:09 +01:00
|
|
|
<refmeta>
|
|
|
|
<refentrytitle><command>nixos-enter</command>
|
|
|
|
</refentrytitle><manvolnum>8</manvolnum>
|
2018-02-05 18:41:54 +00:00
|
|
|
<refmiscinfo class="source">NixOS</refmiscinfo>
|
2018-05-02 00:57:09 +01:00
|
|
|
<!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo> -->
|
|
|
|
</refmeta>
|
|
|
|
<refnamediv>
|
|
|
|
<refname><command>nixos-enter</command>
|
|
|
|
</refname><refpurpose>run a command in a NixOS chroot environment</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsynopsisdiv>
|
2018-06-01 02:03:51 +01:00
|
|
|
<cmdsynopsis>
|
|
|
|
<command>nixos-enter</command>
|
2018-05-02 00:57:09 +01:00
|
|
|
<arg>
|
2018-06-01 02:03:51 +01:00
|
|
|
<arg choice='plain'>
|
|
|
|
<option>--root</option>
|
|
|
|
</arg>
|
|
|
|
<replaceable>root</replaceable>
|
2018-05-02 00:57:09 +01:00
|
|
|
</arg>
|
2018-06-01 02:03:51 +01:00
|
|
|
|
2018-05-02 00:57:09 +01:00
|
|
|
<arg>
|
2018-06-01 02:03:51 +01:00
|
|
|
<arg choice='plain'>
|
|
|
|
<option>--system</option>
|
|
|
|
</arg>
|
|
|
|
<replaceable>system</replaceable>
|
2018-05-02 00:57:09 +01:00
|
|
|
</arg>
|
2018-06-01 02:03:51 +01:00
|
|
|
|
2018-05-02 00:57:09 +01:00
|
|
|
<arg>
|
2018-06-01 02:03:51 +01:00
|
|
|
<arg choice='plain'>
|
|
|
|
<option>-c</option>
|
|
|
|
</arg>
|
|
|
|
<replaceable>shell-command</replaceable>
|
2018-05-02 00:57:09 +01:00
|
|
|
</arg>
|
2018-06-01 02:03:51 +01:00
|
|
|
|
2018-05-02 00:57:09 +01:00
|
|
|
<arg>
|
2018-06-01 02:03:51 +01:00
|
|
|
<arg choice='plain'>
|
|
|
|
<option>--help</option>
|
2018-02-05 18:41:54 +00:00
|
|
|
</arg>
|
2018-05-02 00:57:09 +01:00
|
|
|
</arg>
|
2018-06-01 02:03:51 +01:00
|
|
|
|
2018-05-02 00:57:09 +01:00
|
|
|
<arg>
|
2018-06-01 02:03:51 +01:00
|
|
|
<arg choice='plain'>
|
|
|
|
<option>--</option>
|
|
|
|
</arg>
|
|
|
|
<replaceable>arguments</replaceable>
|
2018-05-02 00:57:09 +01:00
|
|
|
</arg>
|
2018-02-05 18:41:54 +00:00
|
|
|
</cmdsynopsis>
|
2018-05-02 00:57:09 +01:00
|
|
|
</refsynopsisdiv>
|
|
|
|
<refsection>
|
|
|
|
<title>Description</title>
|
|
|
|
<para>
|
|
|
|
This command runs a command in a NixOS chroot environment, that is, in a
|
|
|
|
filesystem hierarchy previously prepared using
|
|
|
|
<command>nixos-install</command>.
|
|
|
|
</para>
|
|
|
|
</refsection>
|
|
|
|
<refsection>
|
|
|
|
<title>Options</title>
|
|
|
|
<para>
|
|
|
|
This command accepts the following options:
|
|
|
|
</para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2018-06-01 02:03:51 +01:00
|
|
|
<term>
|
|
|
|
<option>--root</option>
|
2018-05-02 00:57:09 +01:00
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The path to the NixOS system you want to enter. It defaults to
|
|
|
|
<filename>/mnt</filename>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2018-06-01 02:03:51 +01:00
|
|
|
<term>
|
|
|
|
<option>--system</option>
|
2018-05-02 00:57:09 +01:00
|
|
|
</term>
|
2018-02-05 18:41:54 +00:00
|
|
|
<listitem>
|
2018-05-02 00:57:09 +01:00
|
|
|
<para>
|
|
|
|
The NixOS system configuration to use. It defaults to
|
|
|
|
<filename>/nix/var/nix/profiles/system</filename>. You can enter a
|
|
|
|
previous NixOS configuration by specifying a path such as
|
|
|
|
<filename>/nix/var/nix/profiles/system-106-link</filename>.
|
|
|
|
</para>
|
2018-02-05 18:41:54 +00:00
|
|
|
</listitem>
|
2018-05-02 00:57:09 +01:00
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2018-06-01 02:03:51 +01:00
|
|
|
<term>
|
|
|
|
<option>--command</option>
|
2018-05-02 00:57:09 +01:00
|
|
|
</term>
|
2018-06-01 02:03:51 +01:00
|
|
|
<term>
|
|
|
|
<option>-c</option>
|
2018-05-02 00:57:09 +01:00
|
|
|
</term>
|
2018-02-05 18:41:54 +00:00
|
|
|
<listitem>
|
2018-05-02 00:57:09 +01:00
|
|
|
<para>
|
|
|
|
The bash command to execute.
|
|
|
|
</para>
|
2018-02-05 18:41:54 +00:00
|
|
|
</listitem>
|
2018-05-02 00:57:09 +01:00
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2018-06-01 02:03:51 +01:00
|
|
|
<term>
|
|
|
|
<option>--</option>
|
2018-05-02 00:57:09 +01:00
|
|
|
</term>
|
2018-02-05 18:41:54 +00:00
|
|
|
<listitem>
|
2018-05-02 00:57:09 +01:00
|
|
|
<para>
|
|
|
|
Interpret the remaining arguments as the program name and arguments to be
|
|
|
|
invoked. The program is not executed in a shell.
|
|
|
|
</para>
|
2018-02-05 18:41:54 +00:00
|
|
|
</listitem>
|
2018-05-02 00:57:09 +01:00
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</refsection>
|
|
|
|
<refsection>
|
|
|
|
<title>Examples</title>
|
|
|
|
<para>
|
|
|
|
Start an interactive shell in the NixOS installation in
|
|
|
|
<filename>/mnt</filename>:
|
|
|
|
</para>
|
2018-02-05 18:41:54 +00:00
|
|
|
<screen>
|
|
|
|
# nixos-enter /mnt
|
|
|
|
</screen>
|
2018-05-02 00:57:09 +01:00
|
|
|
<para>
|
|
|
|
Run a shell command:
|
|
|
|
</para>
|
2018-02-05 18:41:54 +00:00
|
|
|
<screen>
|
|
|
|
# nixos-enter -c 'ls -l /; cat /proc/mounts'
|
|
|
|
</screen>
|
2018-05-02 00:57:09 +01:00
|
|
|
<para>
|
|
|
|
Run a non-shell command:
|
|
|
|
</para>
|
2018-02-05 18:41:54 +00:00
|
|
|
<screen>
|
|
|
|
# nixos-enter -- cat /proc/mounts
|
|
|
|
</screen>
|
2018-05-02 00:57:09 +01:00
|
|
|
</refsection>
|
2018-02-05 18:41:54 +00:00
|
|
|
</refentry>
|