Archived
The script was root-only and hard-coded /etc/nix/nix.conf and /etc/ssh/ssh_known_hosts, making it always fail (non-fatally) when called as a non-root SSH user from create-proxmox-resource.sh. Add dual-mode detection based on EUID: - root (multi-user/daemon): existing behavior unchanged -- writes /etc/nix/nix.conf, /etc/ssh/ssh_known_hosts, restarts nix-daemon - non-root (single-user): writes ~/.config/nix/nix.conf and ~/.ssh/known_hosts, creates the config file if missing, skips the daemon restart (single-user has no daemon), defaults REMOTE_BUILDER_KEY to ~/.ssh/id_ed25519 instead of /root/.ssh/id_ed25519 create-proxmox-resource.sh already calls the script without sudo (as the SSH user), so no change is needed there -- the script now handles both cases on its own. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>