nixos-enter(8)

NAME
nixos-enter - run a command in a NixOS chroot environment

SYNOPSIS
nixos-enter [--root root] [--system system] [--command | -c shell-command] [--silent] [--help] [-- arguments ...]

DESCRIPTION
This command runs a command in a NixOS chroot environment, that is, in a filesystem hierarchy previously prepared using nixos-install(8).

OPTIONS

--root root
    The path to the NixOS system you want to enter. It defaults to /mnt .

--system system
    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 .

--command shell-command, -c shell-command
    The bash command to execute.

--silent
    Suppresses all output from the activation script of the target system.

--  Interpret the remaining arguments as the program name and arguments to be invoked. The program is not executed in a shell.

EXAMPLES

nixos-enter --root /mnt
    Start an interactive shell in the NixOS installation in /mnt.

nixos-enter -c 'ls -l /; cat /proc/mounts'
    Run a shell command.

nixos-enter -- cat /proc/mounts
    Run a non-shell command.

AUTHORS
-nosplit Eelco Dolstra and the Nixpkgs/NixOS contributors