diff options
author | Raito Bezarius <masterancpp@gmail.com> | 2022-08-22 16:15:40 +0200 |
---|---|---|
committer | Raito Bezarius <masterancpp@gmail.com> | 2022-08-23 12:13:06 +0200 |
commit | c91d0713ac476dfb367bbe12a7a048f6162f039c (patch) | |
tree | 0609620cf6d8c54bb0f6bb1dc9ef02974bd087f2 /pkgs/applications/virtualization | |
parent | ce907408b8e0d1f0da46388fadfc06c174aff076 (diff) |
ovmf: expose EFI prefixes and refactor qemu-vm with it
Diffstat (limited to 'pkgs/applications/virtualization')
-rw-r--r-- | pkgs/applications/virtualization/OVMF/default.nix | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/pkgs/applications/virtualization/OVMF/default.nix b/pkgs/applications/virtualization/OVMF/default.nix index 82d98274f8ae5..9a4276997b8ee 100644 --- a/pkgs/applications/virtualization/OVMF/default.nix +++ b/pkgs/applications/virtualization/OVMF/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, edk2, util-linux, nasm, acpica-tools +{ stdenv, nixosTests, lib, edk2, util-linux, nasm, acpica-tools , csmSupport ? false, seabios ? null , secureBoot ? false , httpSupport ? false @@ -19,9 +19,15 @@ let throw "Unsupported architecture"; version = lib.getVersion edk2; + + suffixes = { + x86_64 = "FV/OVMF"; + aarch64 = "FV/AAVMF"; + }; + in -edk2.mkDerivation projectDscPath { +edk2.mkDerivation projectDscPath (finalAttrs: { pname = "OVMF"; inherit version; @@ -62,10 +68,23 @@ edk2.mkDerivation projectDscPath { dontPatchELF = true; + passthru = + let + cpuName = stdenv.hostPlatform.parsed.cpu.name; + suffix = suffixes."${cpuName}" or (throw "Host cpu name `${cpuName}` is not supported in this OVMF derivation!"); + prefix = "${finalAttrs.finalPackage.fd}/${suffix}"; + in { + firmware = "${prefix}_CODE.fd"; + variables = "${prefix}_VARS.fd"; + # This will test the EFI firmware for the host platform as part of the NixOS Tests setup. + tests.basic-systemd-boot = nixosTests.systemd-boot.basic; + }; + meta = { description = "Sample UEFI firmware for QEMU and KVM"; homepage = "https://github.com/tianocore/tianocore.github.io/wiki/OVMF"; license = lib.licenses.bsd2; platforms = ["x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin"]; + maintainers = [ lib.maintainers.raitobezarius ]; }; -} +}) |