cli: support machines init-hardware-config --debug
This commit is contained in:
@@ -30,6 +30,7 @@ def update_hardware_config_command(args: argparse.Namespace) -> None:
|
|||||||
machine=machine,
|
machine=machine,
|
||||||
password=args.password,
|
password=args.password,
|
||||||
backend=HardwareConfig(args.backend),
|
backend=HardwareConfig(args.backend),
|
||||||
|
debug=args.debug,
|
||||||
)
|
)
|
||||||
|
|
||||||
if args.target_host:
|
if args.target_host:
|
||||||
@@ -68,6 +69,7 @@ def init_hardware_config_command(args: argparse.Namespace) -> None:
|
|||||||
machine=machine,
|
machine=machine,
|
||||||
password=args.password,
|
password=args.password,
|
||||||
backend=HardwareConfig(args.backend),
|
backend=HardwareConfig(args.backend),
|
||||||
|
debug=args.debug,
|
||||||
)
|
)
|
||||||
|
|
||||||
if args.target_host:
|
if args.target_host:
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ class HardwareGenerateOptions:
|
|||||||
machine: Machine
|
machine: Machine
|
||||||
backend: HardwareConfig = HardwareConfig.NIXOS_FACTER
|
backend: HardwareConfig = HardwareConfig.NIXOS_FACTER
|
||||||
password: str | None = None
|
password: str | None = None
|
||||||
|
debug: bool = False
|
||||||
|
|
||||||
|
|
||||||
@API.register
|
@API.register
|
||||||
@@ -115,6 +116,9 @@ def run_machine_hardware_info_init(
|
|||||||
backup_file = hw_file.with_suffix(".bak")
|
backup_file = hw_file.with_suffix(".bak")
|
||||||
hw_file.replace(backup_file)
|
hw_file.replace(backup_file)
|
||||||
|
|
||||||
|
if opts.debug:
|
||||||
|
cmd += ["--debug"]
|
||||||
|
|
||||||
cmd += [target_host.target]
|
cmd += [target_host.target]
|
||||||
cmd = nix_shell(
|
cmd = nix_shell(
|
||||||
["nixos-anywhere"],
|
["nixos-anywhere"],
|
||||||
|
|||||||
Reference in New Issue
Block a user