nixos-enter(8)

πŸ’… nixos-enter(8) β€” from the System Manager's Manual bestie

okay so picture this: you've got a whole NixOS system sitting there in a directory, and you just want to step inside it and vibe. that's what this page is about. no cap.


✨ 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 🌸

So nixos-enter runs a command inside a NixOS chroot environment β€” like, literally inside a filesystem hierarchy that you already prepared earlier using nixos-install(8). it's giving "teleport into your other self" energy. iconic.


πŸŽ€ OPTIONS πŸŽ€

  • --root root β€” the path to the NixOS system you wanna enter, bestie. defaults to /mnt. (yes, the classic.)
  • --system system β€” which NixOS system configuration to use. defaults to /nix/var/nix/profiles/system. and here's the cute part: you can time-travel back to a previous NixOS configuration by specifying a path like /nix/var/nix/profiles/system-106-link. lowkey obsessed.
  • --command shell-command, -c shell-command β€” the bash command to execute. that's it, that's the whole vibe.
  • --silent β€” suppresses all output from the activation script of the target system. shhh 🀫 main character energy is quiet energy.
  • -- β€” interpret the remaining arguments as the program name and arguments to be invoked. important: the program is not executed in a shell. fr fr, no shell involved.
also --help is in the synopsis up there πŸ‘† so go off if you need it.

🌈 EXAMPLES 🌈

  • nixos-enter --root /mnt β€” start an interactive shell in the NixOS installation in /mnt. slay, you're in. πŸ’…
  • nixos-enter -c 'ls -l /; cat /proc/mounts' β€” run a shell command. two commands, one string, easy.
  • nixos-enter -- cat /proc/mounts β€” run a non-shell command. no shell, just straight to the program. periodt.

πŸ‘‘ AUTHORS πŸ‘‘

Eelco Dolstra and the Nixpkgs/NixOS contributors β€” absolute legends, all of them πŸ’œ


okay that's genuinely the whole page, you ate that. go enter some chroots bestie πŸ¦‹βœ¨

this one's from the Debian manual, dated January 1, 1980 β€” yes really, that date, it's iconic β€” and it's the nixos-enter(8) page. mwah πŸ’‹

πŸ“¦ where this page comes from