diff --git a/nixos-remote-pxe.py b/nixos-anywhere-pxe.py similarity index 98% rename from nixos-remote-pxe.py rename to nixos-anywhere-pxe.py index 06a89081..97e6c36f 100644 --- a/nixos-remote-pxe.py +++ b/nixos-anywhere-pxe.py @@ -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 @@ -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')}" @@ -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:") @@ -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)