From ae9acecbf3cc01f3668fcae561879c0d18b20a76 Mon Sep 17 00:00:00 2001 From: beatzaplenty Date: Thu, 23 Jul 2026 10:39:09 +1000 Subject: [PATCH] fix: sudo the tarball/image staging into /var/lib/vz The post-build cp/mv into /var/lib/vz/template/cache (LXC) and /var/lib/vz/import (VM) are Proxmox-owned root directories -- they need sudo_pfx just like pct/qm/pvesh do. nix build writes to the nix store as the SSH user, but staging into /var/lib/vz/ requires root. Co-Authored-By: Claude Sonnet 4.6 --- scripts/proxmox/create-proxmox-resource.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/proxmox/create-proxmox-resource.sh b/scripts/proxmox/create-proxmox-resource.sh index 7d43d7e..fd4f3a0 100755 --- a/scripts/proxmox/create-proxmox-resource.sh +++ b/scripts/proxmox/create-proxmox-resource.sh @@ -705,8 +705,8 @@ if [[ -z "$built" ]]; then echo "ERROR: no tarball found under result-${target}/tarball after build." >&2 exit 1 fi -mkdir -p "$dest_dir" -cp "$built" "${dest_dir}/${dest_name}" +$sudo_pfx mkdir -p "$dest_dir" +$sudo_pfx cp "$built" "${dest_dir}/${dest_name}" echo "Built and staged: ${dest_dir}/${dest_name}" REMOTE_SCRIPT local_image="$remote_path" @@ -748,8 +748,8 @@ if [[ -z "$built" ]]; then echo "ERROR: no .raw image found in ${repo_dir} after build." >&2 exit 1 fi -mkdir -p "$dest_dir" -mv "$built" "${dest_dir}/${dest_name}" +$sudo_pfx mkdir -p "$dest_dir" +$sudo_pfx mv "$built" "${dest_dir}/${dest_name}" echo "Built and staged: ${dest_dir}/${dest_name}" REMOTE_SCRIPT local_image="$remote_path"