cli: support machines init-hardware-config --debug

This commit is contained in:
Michael Hoang
2025-09-25 22:00:09 +02:00
parent 285e72616e
commit 51bf7c8848
2 changed files with 6 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ def update_hardware_config_command(args: argparse.Namespace) -> None:
machine=machine,
password=args.password,
backend=HardwareConfig(args.backend),
debug=args.debug,
)
if args.target_host:
@@ -68,6 +69,7 @@ def init_hardware_config_command(args: argparse.Namespace) -> None:
machine=machine,
password=args.password,
backend=HardwareConfig(args.backend),
debug=args.debug,
)
if args.target_host:

View File

@@ -66,6 +66,7 @@ class HardwareGenerateOptions:
machine: Machine
backend: HardwareConfig = HardwareConfig.NIXOS_FACTER
password: str | None = None
debug: bool = False
@API.register
@@ -115,6 +116,9 @@ def run_machine_hardware_info_init(
backup_file = hw_file.with_suffix(".bak")
hw_file.replace(backup_file)
if opts.debug:
cmd += ["--debug"]
cmd += [target_host.target]
cmd = nix_shell(
["nixos-anywhere"],