From a99c832ed96ffd7d1ca268202ce651d2c588bd31 Mon Sep 17 00:00:00 2001 From: pinpox Date: Fri, 2 May 2025 12:41:55 +0200 Subject: [PATCH] Set terminal on nix flake update/archive When using resident SSH-keys (-sk), e.g. from a Yubikey that require a Pin, a terminal is needed to be able to enter it during deployment. --- pkgs/clan-cli/clan_cli/machines/update.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/machines/update.py b/pkgs/clan-cli/clan_cli/machines/update.py index 53e6afd38..4ab543f5e 100644 --- a/pkgs/clan-cli/clan_cli/machines/update.py +++ b/pkgs/clan-cli/clan_cli/machines/update.py @@ -69,7 +69,12 @@ def upload_sources(machine: Machine) -> str: ) run( cmd, - RunOpts(env=env, error_msg="failed to upload sources", prefix=machine.name), + RunOpts( + env=env, + needs_user_terminal=True, + error_msg="failed to upload sources", + prefix=machine.name, + ), ) return path @@ -84,7 +89,12 @@ def upload_sources(machine: Machine) -> str: flake_url, ] ) - proc = run(cmd, RunOpts(env=env, error_msg="failed to upload sources")) + proc = run( + cmd, + RunOpts( + env=env, needs_user_terminal=True, error_msg="failed to upload sources" + ), + ) try: return json.loads(proc.stdout)["path"] @@ -193,7 +203,10 @@ def deploy_machines(machines: list[Machine]) -> None: ) ret = host.run( test_cmd if is_mobile else switch_cmd, - RunOpts(msg_color=MsgColor(stderr=AnsiColor.DEFAULT)), + RunOpts( + msg_color=MsgColor(stderr=AnsiColor.DEFAULT), + needs_user_terminal=True, + ), extra_env=env, become_root=become_root, )