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 fa4958d commit 0e05582
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/nixos_anywhere_pxe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,22 +335,24 @@ def ssh_private_key() -> Iterator[SshKey]:
def nixos_anywhere(
ip: str, flake: str, ssh_private_key: Path, nixos_anywhere_args: List[str]
) -> None:
cmd = [
# FIXME: path
"bash",
str(NIXOS_ANYWHERE_SH),
"--flake",
flake,
"-L",
# do not substitute because we do not have internet and copying locally is faster.
"--no-substitute-on-destination",
ip,
] + nixos_anywhere_args
run(
[
# FIXME: path
"bash",
str(NIXOS_ANYWHERE_SH),
"--flake",
flake,
"-L",
# do not substitute because we do not have internet and copying locally is faster.
"--no-substitute-on-destination",
ip,
]
+ nixos_anywhere_args,
cmd,
extra_env=dict(SSH_PRIVATE_KEY=ssh_private_key.read_text()),
check=False,
)
print("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 0e05582

Please sign in to comment.