From 8ccd7e5d9a65c4abb1a451757c9869a9baac207e Mon Sep 17 00:00:00 2001 From: phaer Date: Mon, 19 May 2025 12:37:31 +0200 Subject: [PATCH] amazon-image: Remove tags from label, use version only By default, `system.nixos.label` includes `system.nixos.tags` which historically was not set for the amazon image. Keeping the tag in the label of the generated disk image inside the derivation (i.e. `image.filePath`) makes it easier to tell that the file is for amazon (i.e. `nixos-image-amazon-25.11pre-git-x86_64-linux.vpc`) while the "label" in `image-info.json` for users of the AWS api stays stable (i.e. `/25.05pre-git-x86_64-linux`). ` --- nixos/maintainers/scripts/ec2/amazon-image.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nixos/maintainers/scripts/ec2/amazon-image.nix b/nixos/maintainers/scripts/ec2/amazon-image.nix index d5b23d8a65f6..5b852599d6cf 100644 --- a/nixos/maintainers/scripts/ec2/amazon-image.nix +++ b/nixos/maintainers/scripts/ec2/amazon-image.nix @@ -140,7 +140,7 @@ in echo "file ${cfg.format} $rootDisk" >> $out/nix-support/hydra-build-products ${pkgs.jq}/bin/jq -n \ - --arg system_label ${lib.escapeShellArg config.system.nixos.label} \ + --arg system_version ${lib.escapeShellArg config.system.nixos.version} \ --arg system ${lib.escapeShellArg pkgs.stdenv.hostPlatform.system} \ --arg root_logical_bytes "$(${pkgs.qemu_kvm}/bin/qemu-img info --output json "$rootDisk" | ${pkgs.jq}/bin/jq '."virtual-size"')" \ --arg boot_logical_bytes "$(${pkgs.qemu_kvm}/bin/qemu-img info --output json "$bootDisk" | ${pkgs.jq}/bin/jq '."virtual-size"')" \ @@ -148,7 +148,7 @@ in --arg root "$rootDisk" \ --arg boot "$bootDisk" \ '{} - | .label = $system_label + | .label = $system_version | .boot_mode = $boot_mode | .system = $system | .disks.boot.logical_bytes = $boot_logical_bytes @@ -181,13 +181,13 @@ in echo "file ${cfg.format} $diskImage" >> $out/nix-support/hydra-build-products ${pkgs.jq}/bin/jq -n \ - --arg system_label ${lib.escapeShellArg config.system.nixos.label} \ + --arg system_version ${lib.escapeShellArg config.system.nixos.version} \ --arg system ${lib.escapeShellArg pkgs.stdenv.hostPlatform.system} \ --arg logical_bytes "$(${pkgs.qemu_kvm}/bin/qemu-img info --output json "$diskImage" | ${pkgs.jq}/bin/jq '."virtual-size"')" \ --arg boot_mode "${amiBootMode}" \ --arg file "$diskImage" \ '{} - | .label = $system_label + | .label = $system_version | .boot_mode = $boot_mode | .system = $system | .logical_bytes = $logical_bytes