Using chroot inside nixos

I want to use chroot to access another linux distro from inside nixos but when I’m trying this it says:
chroot: failed to run command ‘/run/current-system/sw/bin/bash’: No such file or directory

Specify the path to your shell: chroot /debian /bin/bash. You’ll probably also need to set the PATH and maybe some other env vars appropriately, this can be done by putting . /etc/profile in the resulting shell.

1 Like

I don’t have /bin/bash in nixos.
how can I get that ?

You don’t need to have /bin/bash in NixOS, when you’re in a chroot with a Debian environment.
The second argument for chroot is the process that will be executed in the chroot.