Skip to content

Commit

Permalink
nixos-anywhere-pxe: explicitly print nixos-anywhere cmd including the…
Browse files Browse the repository at this point in the history
… ssh key

this allows the user to just copy paste the command and run it manually, in case it failed
  • Loading branch information
pogobanane authored and Mic92 committed Nov 28, 2023
1 parent ff3d6b5 commit 7bec491
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/nixos_anywhere_pxe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,7 @@ def ssh_private_key() -> Iterator[SshKey]:
def nixos_anywhere(
ip: str, flake: str, ssh_private_key: Path, nixos_anywhere_args: List[str]
) -> None:
run(
[
cmd = [
# FIXME: path
"bash",
str(NIXOS_ANYWHERE_SH),
Expand All @@ -346,11 +345,13 @@ def nixos_anywhere(
# do not substitute because we do not have internet and copying locally is faster.
"--no-substitute-on-destination",
ip,
]
+ nixos_anywhere_args,
] + nixos_anywhere_args
run(cmd,
extra_env=dict(SSH_PRIVATE_KEY=ssh_private_key.read_text()),
check=False,
)
print(f"If the installation failed, you may run the install command manually again:")
print(f"{cmd} -i {ssh_private_key.read_text()}")


@contextmanager
Expand Down

0 comments on commit 7bec491

Please sign in to comment.