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) <noreply@anthropic.com>
This commit is contained in:
Git Sagar 2026-06-15 10:25:58 -03:00
parent 192ea9b54d
commit f586fa8b6a
2 changed files with 3 additions and 1 deletions

View file

@ -38,6 +38,7 @@
[ -n "${diskSize}" ] && qemu-img resize ${resultImg} ${diskSize} [ -n "${diskSize}" ] && qemu-img resize ${resultImg} ${diskSize}
# run script inside image using virt-customize # run script inside image using virt-customize
export LIBGUESTFS_PATH="${pkgs.libguestfs-with-appliance}/lib/guestfs"
export LIBGUESTFS_APPEND="ipv6.disable=1" export LIBGUESTFS_APPEND="ipv6.disable=1"
${pkgs.guestfs-tools}/bin/virt-customize \ ${pkgs.guestfs-tools}/bin/virt-customize \

View file

@ -137,7 +137,8 @@
mv ${resultImg} $out mv ${resultImg} $out
''; '';
builtImage = pkgs.runCommand customImageName ({ 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" ]; requiredSystemFeatures = [ "kvm" ];
} // lib.optionalAttrs impure { __noChroot = true; }) builderCommand; } // lib.optionalAttrs impure { __noChroot = true; }) builderCommand;
in in