incus-vm: use local: remote for NixOS images, drop nixos/unstable option

linuxcontainers.org (images: remote) does not carry NixOS. Images are
imported locally and aliased (e.g. nixos/25.11). Use local: as the
source remote when is_nixos, and images: for Ubuntu/other distros.

Also removes the nixos/unstable option which has no corresponding
locally-imported image.
This commit is contained in:
Ben Potter 2026-04-25 20:22:22 +00:00
parent 60cb9d9bfc
commit 5260309f4f

View File

@ -75,11 +75,6 @@ data "coder_parameter" "image" {
icon = "/icon/nix.svg"
}
option {
name = "NixOS Unstable"
value = "nixos/unstable"
icon = "/icon/nix.svg"
}
}
data "coder_parameter" "cpu" {
@ -223,7 +218,9 @@ resource "coder_agent" "main" {
resource "incus_image" "image" {
remote = local.incus_remote
source_image = {
remote = "images"
# NixOS images are imported locally (linuxcontainers.org doesn't carry NixOS).
# Ubuntu/other images are pulled from the public images: simplestreams remote.
remote = local.is_nixos ? "local" : "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"