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.
This commit is contained in:
pinpox
2025-05-02 12:41:55 +02:00
committed by Jörg Thalheim
parent 81cd4ea67a
commit 938dc5b155

View File

@@ -69,7 +69,12 @@ def upload_sources(machine: Machine) -> str:
) )
run( run(
cmd, 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 return path
@@ -84,7 +89,12 @@ def upload_sources(machine: Machine) -> str:
flake_url, 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: try:
return json.loads(proc.stdout)["path"] return json.loads(proc.stdout)["path"]
@@ -193,7 +203,10 @@ def deploy_machines(machines: list[Machine]) -> None:
) )
ret = host.run( ret = host.run(
test_cmd if is_mobile else switch_cmd, 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, extra_env=env,
become_root=become_root, become_root=become_root,
) )