Skip to content

Commit 8ccd7e5

Browse files
committed
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`). `
1 parent 949fb7f commit 8ccd7e5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nixos/maintainers/scripts/ec2/amazon-image.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ in
140140
echo "file ${cfg.format} $rootDisk" >> $out/nix-support/hydra-build-products
141141
142142
${pkgs.jq}/bin/jq -n \
143-
--arg system_label ${lib.escapeShellArg config.system.nixos.label} \
143+
--arg system_version ${lib.escapeShellArg config.system.nixos.version} \
144144
--arg system ${lib.escapeShellArg pkgs.stdenv.hostPlatform.system} \
145145
--arg root_logical_bytes "$(${pkgs.qemu_kvm}/bin/qemu-img info --output json "$rootDisk" | ${pkgs.jq}/bin/jq '."virtual-size"')" \
146146
--arg boot_logical_bytes "$(${pkgs.qemu_kvm}/bin/qemu-img info --output json "$bootDisk" | ${pkgs.jq}/bin/jq '."virtual-size"')" \
147147
--arg boot_mode "${amiBootMode}" \
148148
--arg root "$rootDisk" \
149149
--arg boot "$bootDisk" \
150150
'{}
151-
| .label = $system_label
151+
| .label = $system_version
152152
| .boot_mode = $boot_mode
153153
| .system = $system
154154
| .disks.boot.logical_bytes = $boot_logical_bytes
@@ -181,13 +181,13 @@ in
181181
echo "file ${cfg.format} $diskImage" >> $out/nix-support/hydra-build-products
182182
183183
${pkgs.jq}/bin/jq -n \
184-
--arg system_label ${lib.escapeShellArg config.system.nixos.label} \
184+
--arg system_version ${lib.escapeShellArg config.system.nixos.version} \
185185
--arg system ${lib.escapeShellArg pkgs.stdenv.hostPlatform.system} \
186186
--arg logical_bytes "$(${pkgs.qemu_kvm}/bin/qemu-img info --output json "$diskImage" | ${pkgs.jq}/bin/jq '."virtual-size"')" \
187187
--arg boot_mode "${amiBootMode}" \
188188
--arg file "$diskImage" \
189189
'{}
190-
| .label = $system_label
190+
| .label = $system_version
191191
| .boot_mode = $boot_mode
192192
| .system = $system
193193
| .logical_bytes = $logical_bytes

0 commit comments

Comments
 (0)