4

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-18.09.228.80754f5cfd6/init

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 Answers1

2

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.

l0b0
  • 51,350