nixos-remote: check if ssh-host is set

This commit is contained in:
Jörg Thalheim 2022-12-09 16:20:48 +01:00
parent 70de0d8478
commit 1ddff83733

View File

@ -70,6 +70,7 @@ while [[ $# -gt 0 ]]; do
shift
done
# ssh wrapper
timeout_ssh_() {
timeout 10 ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$ssh_connection" "$@"
@ -89,6 +90,10 @@ nix_build() {
"$@"
}
if [ -z ${ssh_connection+x} ]; then
abort "ssh-host must be set"
fi
# parse flake nixos-install style syntax, get the system attr
if [[ ! -z "${flake+x}" ]]; then
if [[ $flake =~ ^(.*)\#([^\#\"]*)$ ]]; then