nix-community/nixos-anywhere

Cancel reboot on NixOS installation error?

Opened this issue · 0 comments

I don't really know what I'm doing, which has resulted in numerous faulty configurations. That's fine. But when I screw up so bad that the system can't reboot, it might be nice if it didn't try. :) Here's the tail of my log:

### Installing NixOS ###
Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: Permanently added '95.216.0.246' (ED25519) to the list of known hosts.
installing the boot loader...
setting up /etc...
Initializing machine ID from random generator.
File system "/dev/md127" is not located on a partitioned block device.
Traceback (most recent call last):
  File "/nix/store/lvkjmhbrp2njbgp8i60nz4hf03h4kv6n-systemd-boot", line 341, in <module>
    main()
  File "/nix/store/lvkjmhbrp2njbgp8i60nz4hf03h4kv6n-systemd-boot", line 258, in main
    subprocess.check_call(["/nix/store/f9wkksb3lslf6q90i6c2r3qji7qcp0f2-systemd-253.6/bin/bootctl", "--esp-path=/boot"] + bootctl_flags + ["install"])
  File "/nix/store/h31x3zrwrws1c3392919br8g9isvhh4x-python3-3.10.13/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/nix/store/f9wkksb3lslf6q90i6c2r3qji7qcp0f2-systemd-253.6/bin/bootctl', '--esp-path=/boot', 'install']' returned non-zero exit status 1.
installation finished!
umount: /mnt/boot unmounted
umount: /mnt (zroot) unmounted
### Waiting for the machine to become reachable again ###
### Done! ###

Maybe it's nixos itself swallowing the bootctl error, in which case this might not be a bug with nixos-anywhere. Annoying.