anchor.diff:          ''-append "$(cat ${config.system.build.toplevel}/kernel-params) init=${config.system.build.toplevel}/init regInfo=${regInfo}/registration ${consoles} $QEMU_KERNEL_PARAMS"''
         ])
         (mkIf cfg.useEFIBoot [
  -        "-pflash $TMPDIR/bios.bin"
  +        "-drive if=pflash,format=raw,unit=0,readonly,file=${efiFirmware}"
  +        "-drive if=pflash,format=raw,unit=1,file=$TMPDIR/EFI_VARS.fd"
         ])
         (mkIf (cfg.bios != null) [
           "-bios ${cfg.bios}/bios.bin"
  
positive.code:             ''
                mkdir $out
                diskImage=$out/disk.img
                bootFlash=$out/bios.bin
                ${qemu}/bin/qemu-img create -f qcow2 $diskImage "40M"
                ${if cfg.useEFIBoot then ''
                  cp ${pkgs.OVMF-CSM.fd}/FV/OVMF.fd $bootFlash
                  chmod 0644 $bootFlash
                '' else ''
                ''}
              '';
            buildInputs = [ pkgs.utillinux ];
            QEMU_OPTS = if cfg.useEFIBoot
                        then "-pflash $out/bios.bin -nographic -serial pty"
                        else "-nographic -serial pty";
          }
          ''
            # Create a /boot EFI partition with 40M and arbitrary but fixed GUIDs for reproducibility
  
negative.code:   addDeviceNames =
      imap1 (idx: drive: drive // { device = driveDeviceName idx; });
  
    efiPrefix = "${pkgs.OVMF.fd}/FV/OVMF";
    efiFirmware = "${efiPrefix}_CODE.fd";
    efiVars = "${efiPrefix}_VARS.fd";
  
    # Shell script to start the VM.
    startVM =
      ''
  