diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix index b1c04d3053938..a7b091013ae7d 100644 --- a/pkgs/applications/virtualization/virtualbox/default.nix +++ b/pkgs/applications/virtualization/virtualbox/default.nix @@ -49,6 +49,9 @@ yasm, glslang, nixosTests, + # If open-watcom-bin is not passed, VirtualBox will fall back to use + # the shipped alternative sources (assembly). + open-watcom-bin, makeself, perl, vulkan-loader, @@ -230,11 +233,18 @@ stdenv.mkDerivation (finalAttrs: { }) # While the KVM patch should not break any other behavior if --with-kvm is not specified, # we don't take any chances and only apply it if people actually want to use KVM support. - ++ optional enableKvm (fetchpatch { - name = "virtualbox-${finalAttrs.virtualboxVersion}-kvm-dev-${finalAttrs.kvmPatchVersion}.patch"; - url = "https://github.com/cyberus-technology/virtualbox-kvm/releases/download/dev-${finalAttrs.kvmPatchVersion}/kvm-backend-${finalAttrs.virtualboxVersion}-dev-${finalAttrs.kvmPatchVersion}.patch"; - hash = finalAttrs.kvmPatchHash; - }) + ++ optional enableKvm ( + let + patchVboxVersion = + # There is no updated patch for 7.0.22 yet, but the older one still applies. + if finalAttrs.virtualboxVersion == "7.0.22" then "7.0.20" else finalAttrs.virtualboxVersion; + in + fetchpatch { + name = "virtualbox-${finalAttrs.virtualboxVersion}-kvm-dev-${finalAttrs.kvmPatchVersion}.patch"; + url = "https://github.com/cyberus-technology/virtualbox-kvm/releases/download/dev-${finalAttrs.kvmPatchVersion}/kvm-backend-${patchVboxVersion}-dev-${finalAttrs.kvmPatchVersion}.patch"; + hash = finalAttrs.kvmPatchHash; + } + ) ++ [ ./qt-dependency-paths.patch # https://github.com/NixOS/nixpkgs/issues/123851 @@ -292,6 +302,7 @@ stdenv.mkDerivation (finalAttrs: { ${optionalString (!enableHardening) "--disable-hardening"} \ ${optionalString (!enable32bitGuests) "--disable-vmmraw"} \ ${optionalString enableWebService "--enable-webservice"} \ + ${optionalString (open-watcom-bin != null) "--with-ow-dir=${open-watcom-bin}"} \ ${optionalString (enableKvm) "--with-kvm"} \ ${extraConfigureFlags} \ --disable-kmods diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 25785bf435105..70de0cb7fe68f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -33072,6 +33072,11 @@ with pkgs; # VirtualBox uses wsimport, which was removed after JDK 8. jdk = jdk8; + + # Opt out of building the guest BIOS sources with the problematic Open Watcom + # toolchain. People who need to build the BIOS from sources (for example to + # apply patches) can override this. + open-watcom-bin = null; }; virtualboxKvm = lowPrio (virtualbox.override {