The Nixos Qemu VM that are used for VM tests can now start without boot menu even when using a bootloader. The Nixos Qemu VM with bootloader can emulate a EFI boot now.
···1+{ stdenv, fetchurl, iasl, python }:
2+3+stdenv.mkDerivation rec {
4+5+ name = "seabios-${version}";
6+ version = "1.7.5.2";
7+8+ src = fetchurl {
9+ url = "http://code.coreboot.org/p/seabios/downloads/get/${name}.tar.gz";
10+ sha256 = "1syd3gi5gq0gj2pjvmdis64xc3j1xf0jgy49ngymap0pdpm0cmh0";
11+ };
12+13+ buildInputs = [ iasl python ];
14+15+ configurePhase = ''
16+ # build SeaBIOS for CSM
17+ cat > .config << EOF
18+ CONFIG_CSM=y
19+ CONFIG_QEMU_HARDWARE=y
20+ CONFIG_PERMIT_UNALIGNED_PCIROM=y
21+ EOF
22+23+ make olddefconfig
24+ '';
25+26+ installPhase = ''
27+ mkdir $out
28+ cp out/Csm16.bin $out/Csm16.bin
29+ '';
30+31+ meta = with stdenv.lib; {
32+ description = "Open source implementation of a 16bit X86 BIOS";
33+ longDescription = ''
34+ SeaBIOS is an open source implementation of a 16bit X86 BIOS.
35+ It can run in an emulator or it can run natively on X86 hardware with the use of coreboot.
36+ SeaBIOS is the default BIOS for QEMU and KVM.
37+ '';
38+ homepage = http://www.seabios.org;
39+ license = licenses.lgpl3;
40+ maintainers = [ maintainers.tstrobel ];
41+ platforms = platforms.linux;
42+ };
43+}
44+