Skip to content

Commit 70909de

Browse files
committed
Add -t param to nixos-anywhere to enable for prompts during installation
1 parent bca7792 commit 70909de

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/nixos-anywhere.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ Options:
1616
* -s, --store-paths <disko-script> <nixos-system>
1717
set the store paths to the disko-script and nixos-system directly
1818
if this is give, flake is not needed
19+
* -t --tty
20+
Force pseudo-terminal allocation in SSH sessions. Use this when you expect e.g.
21+
to be asked for password entry during LUKS configuration.
1922
* --no-reboot
2023
do not reboot after installation, allowing further customization of the target installation.
2124
* --kexec <url>
@@ -59,6 +62,7 @@ nix_options=(
5962
)
6063
substitute_on_destination=y
6164
ssh_private_key_file=
65+
ssh_tty_param="-T"
6266

6367
declare -A disk_encryption_keys
6468
declare -a nix_copy_options
@@ -83,6 +87,9 @@ while [[ $# -gt 0 ]]; do
8387
shift
8488
shift
8589
;;
90+
-t | --tty)
91+
ssh_tty_param="-t"
92+
;;
8693
--help)
8794
showUsage
8895
exit 0
@@ -154,7 +161,7 @@ timeout_ssh_() {
154161
timeout 10 ssh -i "$ssh_key_dir"/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$ssh_connection" "$@"
155162
}
156163
ssh_() {
157-
ssh -T -i "$ssh_key_dir"/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$ssh_connection" "$@"
164+
ssh "$ssh_tty_param" -i "$ssh_key_dir"/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$ssh_connection" "$@"
158165
}
159166

160167
nix_copy() {

0 commit comments

Comments
 (0)