Skip to content

Commit

Permalink
nixos-anywhere: rename from nixos_remote
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed May 15, 2023
1 parent 43b86d0 commit cbad266
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nixos-remote-pxe.py → nixos-anywhere-pxe.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def ssh_private_key() -> Iterator[SshKey]:
yield SshKey(private_key=private_key, public_key=public_key)


def nixos_remote(ip: str, flake: str, ssh_private_key: Path, nixos_anywhere_args: List[str]) -> None:
def nixos_anywhere(ip: str, flake: str, ssh_private_key: Path, nixos_anywhere_args: List[str]) -> None:
run(
[
# FIXME: path
Expand Down Expand Up @@ -377,7 +377,7 @@ def pause():
print("")
input("Press [enter] to terminate this script and tear down the network to the server.")

def run_nixos_remote(options: Options):
def run_nixos_anywhere(options: Options):
pxe_image_store_path = build_pxe_image(options.netboot_image_flake)

random_hostname = f"nixos-pxe-{binascii.b2a_hex(os.urandom(4)).decode('ascii')}"
Expand Down Expand Up @@ -411,7 +411,7 @@ def run_nixos_remote(options: Options):
"Will now run nixos-remote on this target. You can also try to connect to the machine by doing:"
)
print(f" ssh -i {ssh_key.private_key} root@{event.ip_addr}")
nixos_remote(event.ip_addr, options.flake, ssh_key.private_key, options.nixos_anywhere_args)
nixos_anywhere(event.ip_addr, options.flake, ssh_key.private_key, options.nixos_anywhere_args)
# to avoid having to reboot physical machines all the time because networking disappears:
if (options.pause_after_completion):
print("You can connect to the machine by doing:")
Expand All @@ -430,7 +430,7 @@ def main(args: list[str] = sys.argv[1:]) -> None:
options = parse_args(args)
if os.geteuid() != 0:
die("You need to have root privileges to run this script. Exiting.")
run_nixos_remote(options)
run_nixos_anywhere(options)



Expand Down

0 comments on commit cbad266

Please sign in to comment.