From 28922c4421b4a8d8f583913607da4f6db59e65a2 Mon Sep 17 00:00:00 2001 From: Adam Stephens Date: Sat, 20 Jul 2024 09:47:25 -0400 Subject: [PATCH] incus: fix OVMF path backward compatibility incus 6.3.0 changed the OVMF path, but our module needs to support LTS as well. Also move the newer OCI deps to be conditional on version. --- nixos/modules/virtualisation/incus.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nixos/modules/virtualisation/incus.nix b/nixos/modules/virtualisation/incus.nix index 8cb42adc0368..f4c904ff670c 100644 --- a/nixos/modules/virtualisation/incus.nix +++ b/nixos/modules/virtualisation/incus.nix @@ -44,19 +44,21 @@ let qemu-utils qemu_kvm rsync - skopeo squashfs-tools-ng squashfsTools sshfs swtpm systemd thin-provisioning-tools - umoci util-linux virtiofsd xdelta xz ] + ++ lib.optionals (lib.versionAtLeast cfg.package.version "6.3.0") [ + skopeo + umoci + ] ++ lib.optionals config.security.apparmor.enable [ apparmor-bin-utils @@ -111,10 +113,11 @@ let environment = lib.mkMerge [ { INCUS_LXC_TEMPLATE_CONFIG = "${pkgs.lxcfs}/share/lxc/config"; - INCUS_EDK2_PATH = ovmf; INCUS_USBIDS_PATH = "${pkgs.hwdata}/share/hwdata/usb.ids"; PATH = lib.mkForce serverBinPath; } + (lib.mkIf (lib.versionOlder cfg.package.version "6.3.0") { INCUS_OVMF_PATH = ovmf; }) + (lib.mkIf (lib.versionAtLeast cfg.package.version "6.3.0") { INCUS_EDK2_PATH = ovmf; }) (lib.mkIf (cfg.ui.enable) { "INCUS_UI" = cfg.ui.package; }) ];