From abf36cf6fb422a2224f53ddb161d71e0712b1c94 Mon Sep 17 00:00:00 2001 From: "Adam C. Stephens" Date: Fri, 20 Dec 2024 19:17:52 +0000 Subject: [PATCH] nixos/incus: seabios is x86_64 only (cherry picked from commit cbe221c56ab969e3bb21858fd9a3c96de91e96c3) --- nixos/modules/virtualisation/incus.nix | 66 ++++++++++++++------------ 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/nixos/modules/virtualisation/incus.nix b/nixos/modules/virtualisation/incus.nix index 4292662a9152b6..1a29e6ee104e10 100644 --- a/nixos/modules/virtualisation/incus.nix +++ b/nixos/modules/virtualisation/incus.nix @@ -81,38 +81,42 @@ let fdSize2MB = true; }; ovmf-prefix = if pkgs.stdenv.hostPlatform.isAarch64 then "AAVMF" else "OVMF"; - ovmf = pkgs.linkFarm "incus-ovmf" [ - # 2MB must remain the default or existing VMs will fail to boot. New VMs will prefer 4MB - { - name = "OVMF_CODE.fd"; - path = "${OVMF2MB.fd}/FV/${ovmf-prefix}_CODE.fd"; - } - { - name = "OVMF_VARS.fd"; - path = "${OVMF2MB.fd}/FV/${ovmf-prefix}_VARS.fd"; - } - { - name = "OVMF_VARS.ms.fd"; - path = "${OVMF2MB.fd}/FV/${ovmf-prefix}_VARS.fd"; - } + ovmf = pkgs.linkFarm "incus-ovmf" ( + [ + # 2MB must remain the default or existing VMs will fail to boot. New VMs will prefer 4MB + { + name = "OVMF_CODE.fd"; + path = "${OVMF2MB.fd}/FV/${ovmf-prefix}_CODE.fd"; + } + { + name = "OVMF_VARS.fd"; + path = "${OVMF2MB.fd}/FV/${ovmf-prefix}_VARS.fd"; + } + { + name = "OVMF_VARS.ms.fd"; + path = "${OVMF2MB.fd}/FV/${ovmf-prefix}_VARS.fd"; + } - { - name = "OVMF_CODE.4MB.fd"; - path = "${pkgs.OVMFFull.fd}/FV/${ovmf-prefix}_CODE.fd"; - } - { - name = "OVMF_VARS.4MB.fd"; - path = "${pkgs.OVMFFull.fd}/FV/${ovmf-prefix}_VARS.fd"; - } - { - name = "OVMF_VARS.4MB.ms.fd"; - path = "${pkgs.OVMFFull.fd}/FV/${ovmf-prefix}_VARS.fd"; - } - { - name = "seabios.bin"; - path = "${pkgs.seabios-qemu}/share/seabios/bios.bin"; - } - ]; + { + name = "OVMF_CODE.4MB.fd"; + path = "${pkgs.OVMFFull.fd}/FV/${ovmf-prefix}_CODE.fd"; + } + { + name = "OVMF_VARS.4MB.fd"; + path = "${pkgs.OVMFFull.fd}/FV/${ovmf-prefix}_VARS.fd"; + } + { + name = "OVMF_VARS.4MB.ms.fd"; + path = "${pkgs.OVMFFull.fd}/FV/${ovmf-prefix}_VARS.fd"; + } + ] + ++ lib.optionals pkgs.stdenv.hostPlatform.isx86_64 [ + { + name = "seabios.bin"; + path = "${pkgs.seabios-qemu}/share/seabios/bios.bin"; + } + ] + ); environment = lib.mkMerge [ {