From 8a282ee32e5659d9351055554a498313cec76179 Mon Sep 17 00:00:00 2001 From: beatzaplenty Date: Thu, 23 Jul 2026 10:10:29 +1000 Subject: [PATCH] fix: don't sudo nix build in remote scripts nix build runs through the nix daemon and doesn't need root; the tooling-check step already confirms the SSH user can run nix directly (ensure_nix_profile + command -v nix). sudo without a TTY blocks non-interactive SSH heredoc sessions with "a terminal is required". Keep sudo on pct/qm/pvesh (cluster IPC) and the disko image-writer script (writes to block devices) -- those actually require root. Co-Authored-By: Claude Sonnet 4.6 --- scripts/proxmox/create-proxmox-resource.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/proxmox/create-proxmox-resource.sh b/scripts/proxmox/create-proxmox-resource.sh index 9683f21..7d43d7e 100755 --- a/scripts/proxmox/create-proxmox-resource.sh +++ b/scripts/proxmox/create-proxmox-resource.sh @@ -696,7 +696,7 @@ cd "$repo_dir" # right after a successful install. . scripts/lib/nix-bootstrap.sh ensure_nix_profile -NIXOS_HOST_KEYS_DIR="$(pwd)/host-keys" $sudo_pfx nix build --impure \ +NIXOS_HOST_KEYS_DIR="$(pwd)/host-keys" nix build --impure \ --no-use-registries --no-accept-flake-config "${NIX_OPTS[@]}" \ ".#nixosConfigurations.${target}.config.system.build.tarball" \ --out-link "result-${target}" @@ -736,7 +736,7 @@ declare -a NIX_OPTS=() cd "$repo_dir" . scripts/lib/nix-bootstrap.sh ensure_nix_profile -$sudo_pfx nix build --no-use-registries --no-accept-flake-config "${NIX_OPTS[@]}" \ +nix build --no-use-registries --no-accept-flake-config "${NIX_OPTS[@]}" \ ".#nixosConfigurations.${target}.config.system.build.diskoImagesScript" \ --out-link "result-${target}" $sudo_pfx "./result-${target}" \ -- 2.54.0