Skip to content

Commit 6d6704c

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 4b9c087 commit 6d6704c

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

src/nixos_anywhere_pxe/__init__.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -346,22 +346,25 @@ def nixos_anywhere(
346346
ssh_private_key: Path,
347347
nixos_anywhere_args: list[str],
348348
) -> None:
349+
cmd = [
350+
# FIXME: path
351+
"bash",
352+
str(NIXOS_ANYWHERE_SH),
353+
"--flake",
354+
flake,
355+
"-L",
356+
# do not substitute because we do not have internet and copying locally is faster.
357+
"--no-substitute-on-destination",
358+
ip,
359+
*nixos_anywhere_args,
360+
]
349361
run(
350-
[
351-
# FIXME: path
352-
"bash",
353-
str(NIXOS_ANYWHERE_SH),
354-
"--flake",
355-
flake,
356-
"-L",
357-
# do not substitute because we do not have internet and copying locally is faster.
358-
"--no-substitute-on-destination",
359-
ip,
360-
]
361-
+ nixos_anywhere_args,
362+
cmd,
362363
extra_env=dict(SSH_PRIVATE_KEY=ssh_private_key.read_text()),
363364
check=False,
364365
)
366+
print("If the installation failed, you may run the install command manually again:")
367+
print(f"{cmd} -i {ssh_private_key.read_text()}")
365368

366369

367370
@contextmanager

0 commit comments

Comments
 (0)