Add -t param to nixos-anywhere to enable for prompts during installation

This commit is contained in:
Jacek Galowicz 2023-06-13 20:16:34 +02:00
parent bca7792e79
commit 70909def0c

View File

@ -16,6 +16,9 @@ Options:
* -s, --store-paths <disko-script> <nixos-system>
set the store paths to the disko-script and nixos-system directly
if this is give, flake is not needed
* -t --tty
Force pseudo-terminal allocation in SSH sessions. Use this when you expect e.g.
to be asked for password entry during LUKS configuration.
* --no-reboot
do not reboot after installation, allowing further customization of the target installation.
* --kexec <url>
@ -59,6 +62,7 @@ nix_options=(
)
substitute_on_destination=y
ssh_private_key_file=
ssh_tty_param="-T"
declare -A disk_encryption_keys
declare -a nix_copy_options
@ -83,6 +87,9 @@ while [[ $# -gt 0 ]]; do
shift
shift
;;
-t | --tty)
ssh_tty_param="-t"
;;
--help)
showUsage
exit 0
@ -154,7 +161,7 @@ timeout_ssh_() {
timeout 10 ssh -i "$ssh_key_dir"/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$ssh_connection" "$@"
}
ssh_() {
ssh -T -i "$ssh_key_dir"/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$ssh_connection" "$@"
ssh "$ssh_tty_param" -i "$ssh_key_dir"/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$ssh_connection" "$@"
}
nix_copy() {