1.Dd January 1, 1980
2.Dt nixos-enter 8
3.Os
4.Sh NAME
5.Nm nixos-enter
6.Nd run a command in a NixOS chroot environment
7.
8.
9.
10.Sh SYNOPSIS
11.Nm nixos-enter
12.Op Fl -root Ar root
13.Op Fl -system Ar system
14.Op Fl -command | c Ar shell-command
15.Op Fl -silent
16.Op Fl -help
17.Op Fl - Ar arguments ...
18.
19.
20.
21.Sh DESCRIPTION
22This command runs a command in a NixOS chroot environment, that is, in a filesystem hierarchy previously prepared using
23.Xr nixos-install 8 .
24.
25.
26.
27.Sh OPTIONS
28.Bl -tag -width indent
29.It Fl -root Ar root
30The path to the NixOS system you want to enter. It defaults to
31.Pa /mnt Ns
32\&.
33.It Fl -system Ar system
34The NixOS system configuration to use. It defaults to
35.Pa /nix/var/nix/profiles/system Ns
36\&. You can enter a previous NixOS configuration by specifying a path such as
37.Pa /nix/var/nix/profiles/system-106-link Ns
38\&.
39.
40.It Fl -command Ar shell-command , Fl c Ar shell-command
41The bash command to execute.
42.
43.It Fl -silent
44Suppresses all output from the activation script of the target system.
45.
46.It Fl -
47Interpret the remaining arguments as the program name and arguments to be invoked.
48The program is not executed in a shell.
49.El
50.
51.
52.
53.Sh EXAMPLES
54.Bl -tag -width indent
55.It Ic nixos-enter --root /mnt
56Start an interactive shell in the NixOS installation in
57.Pa /mnt Ns .
58.
59.It Ic nixos-enter -c 'ls -l /; cat /proc/mounts'
60Run a shell command.
61.
62.It Ic nixos-enter -- cat /proc/mounts
63Run a non-shell command.
64.El
65.
66.
67.
68.Sh AUTHORS
69.An -nosplit
70.An Eelco Dolstra
71and
72.An the Nixpkgs/NixOS contributors