From 9bc3d808c1c7d135a3d820a2c85eea488491bf22 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Thu, 13 Feb 2025 15:21:02 +1100 Subject: [PATCH] clan-cli: machines install: add phases option for nixos-anywhere --- pkgs/clan-cli/clan_cli/machines/install.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/clan-cli/clan_cli/machines/install.py b/pkgs/clan-cli/clan_cli/machines/install.py index 1f525e8c1..aeed53774 100644 --- a/pkgs/clan-cli/clan_cli/machines/install.py +++ b/pkgs/clan-cli/clan_cli/machines/install.py @@ -32,6 +32,7 @@ class InstallOptions: kexec: str | None = None debug: bool = False no_reboot: bool = False + phases: str | None = None build_on_remote: bool = False nix_options: list[str] = field(default_factory=list) update_hardware_config: HardwareConfig = HardwareConfig.NONE @@ -95,6 +96,9 @@ def install_machine(opts: InstallOptions) -> None: if opts.no_reboot: cmd.append("--no-reboot") + if opts.phases: + cmd += ["--phases", str(opts.phases)] + if opts.update_hardware_config is not HardwareConfig.NONE: cmd.extend( [ @@ -185,6 +189,7 @@ def install_command(args: argparse.Namespace) -> None: machine=machine, target_host=target_host, kexec=args.kexec, + phases=args.phases, debug=args.debug, no_reboot=args.no_reboot, nix_options=args.option, @@ -208,7 +213,7 @@ def register_install_parser(parser: argparse.ArgumentParser) -> None: parser.add_argument( "--no-reboot", action="store_true", - help="do not reboot after installation", + help="do not reboot after installation (deprecated)", default=False, ) parser.add_argument( @@ -237,6 +242,12 @@ def register_install_parser(parser: argparse.ArgumentParser) -> None: choices=[x.value for x in HardwareConfig], ) + parser.add_argument( + "--phases", + type=str, + help="comma separated list of phases to run. Default is: kexec,disko,install,reboot", + ) + machines_parser = parser.add_argument( "machine", type=str,