From 47c83cb438298e4c78f1b982f996acd0478367d7 Mon Sep 17 00:00:00 2001 From: phaer Date: Fri, 15 Nov 2024 00:02:35 +0100 Subject: [PATCH] virtualisation/linode-image: Use system.build.image --- nixos/modules/virtualisation/linode-image.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/linode-image.nix b/nixos/modules/virtualisation/linode-image.nix index ff61c5f5d1db..80aefbf54a36 100644 --- a/nixos/modules/virtualisation/linode-image.nix +++ b/nixos/modules/virtualisation/linode-image.nix @@ -20,6 +20,7 @@ in imports = [ ./linode-config.nix ./disk-size-option.nix + ../image/file-options.nix (lib.mkRenamedOptionModuleWith { sinceRelease = 2411; from = [ @@ -57,13 +58,17 @@ in }; config = { + system.nixos.tags = [ "linode" ]; + image.extension = "img.gz"; + system.build.image = config.system.build.linodeImage; system.build.linodeImage = import ../../lib/make-disk-image.nix { name = "linode-image"; + baseName = config.image.baseName; # NOTE: Linode specifically requires images to be `gzip`-ed prior to upload # See: https://www.linode.com/docs/products/tools/images/guides/upload-an-image/#requirements-and-considerations postVM = '' ${pkgs.gzip}/bin/gzip -${toString cfg.compressionLevel} -c -- $diskImage > \ - $out/nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.img.gz + $out/${config.image.fileName} rm $diskImage ''; format = "raw";