summary refs log tree commit diff
path: root/nixos/tests/systemd-boot.nix
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2020-12-20 20:04:15 +0100
committerBjørn Forsman <bjorn.forsman@gmail.com>2020-12-21 08:55:13 +0100
commit39fad297fdc87f8718f654f0fdd01c4cacc5b1f8 (patch)
tree2f3646a62c2af893ebbb1f5f8bb20bec84ac9bdb /nixos/tests/systemd-boot.nix
parentb1499452b8c7e0ae584e4bbfadd5b63836249bbf (diff)
downloadnixpkgs-39fad297fdc87f8718f654f0fdd01c4cacc5b1f8.tar
nixpkgs-39fad297fdc87f8718f654f0fdd01c4cacc5b1f8.tar.gz
nixpkgs-39fad297fdc87f8718f654f0fdd01c4cacc5b1f8.tar.bz2
nixpkgs-39fad297fdc87f8718f654f0fdd01c4cacc5b1f8.tar.lz
nixpkgs-39fad297fdc87f8718f654f0fdd01c4cacc5b1f8.tar.xz
nixpkgs-39fad297fdc87f8718f654f0fdd01c4cacc5b1f8.tar.zst
nixpkgs-39fad297fdc87f8718f654f0fdd01c4cacc5b1f8.zip
nixos: fix "nixos-rebuild build-vm-with-bootloader" for EFI systems
`nixos-rebuild build-vm-with-bootloader` currently fails with the
default NixOS EFI configuration:

  $ cat >configuration.nix <<EOF
  {
    fileSystems."/".device = "/dev/sda1";
    boot.loader.systemd-boot.enable = true;
    boot.loader.efi.canTouchEfiVariables = true;
  }
  EOF

  $ nixos-rebuild build-vm-with-bootloader -I nixos-config=$PWD/configuration.nix -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-20.09.tar.gz
  [...]
  insmod: ERROR: could not insert module /nix/store/1ibmgfr13r8b6xyn4f0wj115819f359c-linux-5.4.83/lib/modules/5.4.83/kernel/fs/efivarfs/efivarfs.ko.xz: No such device
  mount: /sys/firmware/efi/efivars: mount point does not exist.
  [    1.908328] reboot: Power down
  builder for '/nix/store/dx2ycclyknvibrskwmii42sgyalagjxa-nixos-boot-disk.drv' failed with exit code 32
  [...]

Fix it by setting virtualisation.useEFIBoot = true in qemu-vm.nix, when
efi is needed.

And remove the now unneeded configuration in
./nixos/tests/systemd-boot.nix, since it's handled globally.

Before:
* release-20.03: successful build, unsuccessful run
* release-20.09 (and master): unsuccessful build

After:
* Successful build and run.

Fixes https://github.com/NixOS/nixpkgs/issues/107255
Diffstat (limited to 'nixos/tests/systemd-boot.nix')
-rw-r--r--nixos/tests/systemd-boot.nix1
1 files changed, 0 insertions, 1 deletions
diff --git a/nixos/tests/systemd-boot.nix b/nixos/tests/systemd-boot.nix
index 7a663dd9b42..a37c87bccc2 100644
--- a/nixos/tests/systemd-boot.nix
+++ b/nixos/tests/systemd-boot.nix
@@ -9,7 +9,6 @@ with pkgs.lib;
 let
   common = {
     virtualisation.useBootLoader = true;
-    virtualisation.useEFIBoot = true;
     boot.loader.systemd-boot.enable = true;
     boot.loader.efi.canTouchEfiVariables = true;
     environment.systemPackages = [ pkgs.efibootmgr ];