virtualisation/azure-image: use system.build.image

This commit is contained in:
phaer 2024-11-15 00:35:48 +01:00
parent 77fce1dc58
commit f3563c996e

View File

@ -13,6 +13,7 @@ in
imports = [
./azure-common.nix
./disk-size-option.nix
../image/file-options.nix
(lib.mkRenamedOptionModuleWith {
sinceRelease = 2411;
from = [
@ -61,10 +62,14 @@ in
};
config = {
image.extension = "vhd";
system.nixos.tags = [ "azure" ];
system.build.image = config.system.build.azureImage;
system.build.azureImage = import ../../lib/make-disk-image.nix {
name = "azure-image";
inherit (config.image) baseName;
postVM = ''
${pkgs.vmTools.qemu}/bin/qemu-img convert -f raw -o subformat=fixed,force_size -O vpc $diskImage $out/disk.vhd
${pkgs.vmTools.qemu}/bin/qemu-img convert -f raw -o subformat=fixed,force_size -O vpc $diskImage $out/${config.image.fileName}
rm $diskImage
'';
configFile = ./azure-config-user.nix;