From f586fa8b6add36bce755c8da7bbcaf56235ced4e Mon Sep 17 00:00:00 2001 From: Git Sagar Date: Mon, 15 Jun 2026 10:25:58 -0300 Subject: [PATCH] use pre-built guestfs appliance via libguestfs-with-appliance Set LIBGUESTFS_PATH so virt-customize uses the nixpkgs pre-built appliance instead of building one at runtime. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/images/linux/customizeImage.nix | 1 + lib/images/windows/helpers/customizeImage.nix | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/images/linux/customizeImage.nix b/lib/images/linux/customizeImage.nix index a87b0f2..9d04774 100644 --- a/lib/images/linux/customizeImage.nix +++ b/lib/images/linux/customizeImage.nix @@ -38,6 +38,7 @@ [ -n "${diskSize}" ] && qemu-img resize ${resultImg} ${diskSize} # run script inside image using virt-customize + export LIBGUESTFS_PATH="${pkgs.libguestfs-with-appliance}/lib/guestfs" export LIBGUESTFS_APPEND="ipv6.disable=1" ${pkgs.guestfs-tools}/bin/virt-customize \ diff --git a/lib/images/windows/helpers/customizeImage.nix b/lib/images/windows/helpers/customizeImage.nix index 19758b9..a4a2a00 100644 --- a/lib/images/windows/helpers/customizeImage.nix +++ b/lib/images/windows/helpers/customizeImage.nix @@ -137,7 +137,8 @@ mv ${resultImg} $out ''; builtImage = pkgs.runCommand customImageName ({ - nativeBuildInputs = with pkgs; [ qemu perl guestfs-tools ]; + nativeBuildInputs = with pkgs; [ qemu perl guestfs-tools libguestfs-with-appliance ]; + LIBGUESTFS_PATH = "${pkgs.libguestfs-with-appliance}/lib/guestfs"; requiredSystemFeatures = [ "kvm" ]; } // lib.optionalAttrs impure { __noChroot = true; }) builderCommand; in