From 60cb23001a1e8e4102ce905810c5641a7eb3a237 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 5 Feb 2018 19:41:54 +0100 Subject: Add a "nixos-enter" command This factors out the functionality in nixos-install for running a command inside a NixOS installation (nixos-install --chroot). --- nixos/doc/manual/man-nixos-enter.xml | 119 +++++++++++++++++++++++++++++++++++ nixos/doc/manual/man-pages.xml | 3 +- 2 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 nixos/doc/manual/man-nixos-enter.xml (limited to 'nixos/doc/manual') diff --git a/nixos/doc/manual/man-nixos-enter.xml b/nixos/doc/manual/man-nixos-enter.xml new file mode 100644 index 00000000000..a2fbe07961d --- /dev/null +++ b/nixos/doc/manual/man-nixos-enter.xml @@ -0,0 +1,119 @@ + + + + nixos-enter + 8 + NixOS + + + + + nixos-enter + run a command in a NixOS chroot environment + + + + + nixos-enter + + + root + + + + system + + + + shell-command + + + + + + + arguments + + + + + +Description + +This command runs a command in a NixOS chroot environment, that +is, in a filesystem hierarchy previously prepared using +nixos-install. + + + +Options + +This command accepts the following options: + + + + + + + The path to the NixOS system you want to enter. It defaults to /mnt. + + + + + + + The NixOS system configuration to use. It defaults to + /nix/var/nix/profiles/system. You can enter + a previous NixOS configuration by specifying a path such as + /nix/var/nix/profiles/system-106-link. + + + + + + + + The bash command to execute. + + + + + + + Interpret the remaining arguments as the program + name and arguments to be invoked. The program is not executed in a + shell. + + + + + + + + +Examples + +Start an interactive shell in the NixOS installation in +/mnt: + + +# nixos-enter /mnt + + +Run a shell command: + + +# nixos-enter -c 'ls -l /; cat /proc/mounts' + + +Run a non-shell command: + + +# nixos-enter -- cat /proc/mounts + + + + + diff --git a/nixos/doc/manual/man-pages.xml b/nixos/doc/manual/man-pages.xml index e945e0e6263..80a8458fbfe 100644 --- a/nixos/doc/manual/man-pages.xml +++ b/nixos/doc/manual/man-pages.xml @@ -15,7 +15,7 @@ - 2007-2015 + 2007-2018 Eelco Dolstra @@ -25,6 +25,7 @@ + -- cgit 1.4.1