From 41db5209c7455c69f64cd1b65039c287bb06c5ff Mon Sep 17 00:00:00 2001 From: phaer Date: Fri, 15 Nov 2024 00:30:30 +0100 Subject: [PATCH] virtualisation/google-compute: use system.build.image --- .../modules/virtualisation/google-compute-image.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nixos/modules/virtualisation/google-compute-image.nix b/nixos/modules/virtualisation/google-compute-image.nix index c2529bb3db3f..8bdbd75783a4 100644 --- a/nixos/modules/virtualisation/google-compute-image.nix +++ b/nixos/modules/virtualisation/google-compute-image.nix @@ -22,6 +22,7 @@ in imports = [ ./google-compute-config.nix ./disk-size-option.nix + ../image/file-options.nix (lib.mkRenamedOptionModuleWith { sinceRelease = 2411; from = [ @@ -72,8 +73,12 @@ in fsType = "vfat"; }; + system.nixos.tags = [ "google-compute" ]; + image.extension = "raw.tar.gz"; + system.build.image = config.system.build.googleComputeImage; system.build.googleComputeImage = import ../../lib/make-disk-image.nix { name = "google-compute-image"; + inherit (config.image) baseName; postVM = '' PATH=$PATH:${ with pkgs; @@ -83,10 +88,9 @@ in ] } pushd $out - mv $diskImage disk.raw - tar -Sc disk.raw | gzip -${toString cfg.compressionLevel} > \ - nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.raw.tar.gz - rm $out/disk.raw + tar -Sc $diskImage | gzip -${toString cfg.compressionLevel} > \ + ${config.image.fileName} + rm $diskImage popd ''; format = "raw";