On a nixos installation how does one boot into single user mode?

On a typical linux installation one would set rw init=/sysroot/bin/sh on the bootloader. But nixos being nixos, it has a path that looks like init=/nix/store/[LONG-HASH]-nixos-system-nixos-

What is the correct path to /bin/sh? Or is there a better way to boot to single user mode on nixos for the purpose of resetting the root password?


1 Answer 1


In a GRUB 2 menu you can press e to edit the startup details. Add the word single or rescue to the line starting with linux, then press F10 to start in single-user or rescue mode, respectively.

You'll then need to systemctl start network-online.target to enable networking.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .