qemu-vm.nix: Fix device name hardcodes on `useBootLoader`.
boot.loader.grub.device` was hardcoded to `bootDevice`, which is wrong, because that's the device for `/`, and with `useBootLoader` the boot loader is not on that device. This bug probably came into existence because of bad naming; `virtualisation.bootDevice` has description "The disk to be used for the root filesystem", which is very confusing; it should be `.rootDevice` then! Unfortunately, the description is right and the attribute name is wrong, so it is not easy to change this without deprecation. This commit ensures that even if you use `useBootLoader` and `diskInterface == "scsi"`, the created VM can boot through, and can run `nixos-rebuild afterwards. It also adds extra commentary to explain what's going on in this module in general in relation to `useBootLoader`.
parent
2fa351b6
Please register or sign in to comment