fix broken eval check when nixpkgs.pkgs nixos option is used
This commit is contained in:
@@ -81,7 +81,7 @@ def show_machine_hardware_platform(clan_dir: Path, machine_name: str) -> str | N
|
|||||||
[
|
[
|
||||||
f"{clan_dir}#clanInternals.machines.{system}.{machine_name}",
|
f"{clan_dir}#clanInternals.machines.{system}.{machine_name}",
|
||||||
"--apply",
|
"--apply",
|
||||||
"machine: { inherit (machine.config.nixpkgs.hostPlatform) system; }",
|
"machine: { inherit (machine.pkgs) system; }",
|
||||||
"--json",
|
"--json",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@@ -164,8 +164,10 @@ def generate_machine_hardware_info(opts: HardwareGenerateOptions) -> HardwareRep
|
|||||||
raise ClanError(msg)
|
raise ClanError(msg)
|
||||||
|
|
||||||
backup_file = None
|
backup_file = None
|
||||||
with hw_file.open("w") as f:
|
if hw_file.exists():
|
||||||
f.write(out.stdout)
|
backup_file = hw_file.with_suffix(".bak")
|
||||||
|
hw_file.replace(backup_file)
|
||||||
|
hw_file.write_text(out.stdout)
|
||||||
print(f"Successfully generated: {hw_file}")
|
print(f"Successfully generated: {hw_file}")
|
||||||
|
|
||||||
# try to evaluate the machine
|
# try to evaluate the machine
|
||||||
@@ -204,8 +206,6 @@ def update_hardware_config_command(args: argparse.Namespace) -> None:
|
|||||||
backend=args.backend,
|
backend=args.backend,
|
||||||
)
|
)
|
||||||
generate_machine_hardware_info(opts)
|
generate_machine_hardware_info(opts)
|
||||||
print("Successfully generated hardware information.")
|
|
||||||
print(f"Target: {opts.machine} ({opts.target_host})")
|
|
||||||
|
|
||||||
|
|
||||||
def register_update_hardware_config(parser: argparse.ArgumentParser) -> None:
|
def register_update_hardware_config(parser: argparse.ArgumentParser) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user