From a8e04991bf9c6f28e28105f8f8966e3a789853b7 Mon Sep 17 00:00:00 2001 From: Ben Potter Date: Mon, 27 Apr 2026 13:06:13 +0000 Subject: [PATCH] incus-vm: fix NixOS image lookup using same-remote alias resolution source_image.remote="local" was resolving against the provisioner machine, not the target incus host. Use local.incus_remote (same remote as destination) so the alias nixos/25.11 is looked up on the host that actually has the image cached. --- registry/bpmct/templates/incus-vm/main.tf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/registry/bpmct/templates/incus-vm/main.tf b/registry/bpmct/templates/incus-vm/main.tf index 02e0798c..bd81ba76 100644 --- a/registry/bpmct/templates/incus-vm/main.tf +++ b/registry/bpmct/templates/incus-vm/main.tf @@ -218,9 +218,11 @@ resource "coder_agent" "main" { resource "incus_image" "image" { remote = local.incus_remote source_image = { - # NixOS images are imported locally (linuxcontainers.org doesn't carry NixOS). + # NixOS images are stored directly on the target incus host (linuxcontainers.org + # doesn't carry NixOS). Use the same remote as the destination so the provider + # resolves the alias locally on that host rather than on the provisioner. # Ubuntu/other images are pulled from the public images: simplestreams remote. - remote = local.is_nixos ? "local" : "images" + remote = local.is_nixos ? local.incus_remote : "images" name = local.is_nixos ? data.coder_parameter.image.value : "${data.coder_parameter.image.value}/${data.coder_parameter.host.value == "ThinkStation" ? "amd64" : "arm64"}" type = "virtual-machine" architecture = data.coder_parameter.host.value == "ThinkStation" ? "x86_64" : "aarch64"