diff --git a/src/nixos/chroot.md b/src/nixos/chroot.md new file mode 100644 index 0000000..f2faa20 --- /dev/null +++ b/src/nixos/chroot.md @@ -0,0 +1,19 @@ +# Entering nixos chroot from rescue + +``` +mount /dev/sda1 /mnt + +mount -o bind /dev /mnt/dev + +mount -o bind /proc /mnt/proc + +mount -o bind /sys /mnt/sys + +chroot /mnt /nix/var/nix/profiles/system/activate + +cp /etc/resolv.conf /mnt/etc/ + +chroot /mnt /run/current-system/sw/bin/bash +``` + +Use `--option sandbox false` when `nixos-rebuild` \ No newline at end of file