Skip to content

Commit e5492b5

Browse files
pogobananeMic92
authored andcommitted
nixos-anywhere-pxe: explicitly print nixos-anywhere cmd including the ssh key
this allows the user to just copy paste the command and run it manually, in case it failed
1 parent 7a6bef8 commit e5492b5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/nixos_anywhere_pxe/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,7 @@ def ssh_private_key() -> Iterator[SshKey]:
335335
def nixos_anywhere(
336336
ip: str, flake: str, ssh_private_key: Path, nixos_anywhere_args: List[str]
337337
) -> None:
338-
run(
339-
[
338+
cmd = [
340339
# FIXME: path
341340
"bash",
342341
str(NIXOS_ANYWHERE_SH),
@@ -346,11 +345,13 @@ def nixos_anywhere(
346345
# do not substitute because we do not have internet and copying locally is faster.
347346
"--no-substitute-on-destination",
348347
ip,
349-
]
350-
+ nixos_anywhere_args,
348+
] + nixos_anywhere_args
349+
run(cmd,
351350
extra_env=dict(SSH_PRIVATE_KEY=ssh_private_key.read_text()),
352351
check=False,
353352
)
353+
print("If the installation failed, you may run the install command manually again:")
354+
print(f"{cmd} -i {ssh_private_key.read_text()}")
354355

355356

356357
@contextmanager

0 commit comments

Comments
 (0)