From 4d148268258732a216dc83327fe16073082d1063 Mon Sep 17 00:00:00 2001 From: Daniel Fullmer Date: Sat, 13 Jun 2020 23:22:20 -0400 Subject: [PATCH] qemu-vm: allow bootloader to set EFI vars Without this, systemd-boot does not add an EFI boot entry for itself. The reason it worked before this fix is because it would fall back to the default installed \EFI\BOOT\BOOTX64.EFI --- nixos/modules/virtualisation/qemu-vm.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index 5a502c36180..c9061ea0608 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -210,6 +210,10 @@ let mkdir /boot mount /dev/vda2 /boot + ${optionalString config.boot.loader.efi.canTouchEfiVariables '' + mount -t efivarfs efivarfs /sys/firmware/efi/efivars + ''} + # This is needed for GRUB 0.97, which doesn't know about virtio devices. mkdir /boot/grub echo '(hd0) /dev/vda' > /boot/grub/device.map