use packaged nixos-facter in generate_hardware_info

This commit is contained in:
Jörg Thalheim
2024-09-20 13:34:15 +02:00
parent bd383a9f35
commit 5b878ac8ac

View File

@@ -117,13 +117,16 @@ def generate_machine_hardware_info(
if hostname is not None:
machine.target_host_address = hostname
nixos_generate_cmd = [
"nixos-generate-config", # Filesystems are managed by disko
config_command = (
["nixos-facter"]
if report_type == "nixos-facter"
else [
"nixos-generate-config",
# Filesystems are managed by disko
"--no-filesystems",
"--show-hardware-config",
]
nixos_facter_cmd = ["nix", "run", "--refresh", "github:numtide/nixos-facter"]
)
host = machine.target_host
target_host = f"{host.user or 'root'}@{host.host}"
@@ -148,11 +151,7 @@ def generate_machine_hardware_info(
else []
),
target_host,
*(
nixos_generate_cmd
if report_type == "nixos-generate-config"
else nixos_facter_cmd
),
*config_command,
],
)
out = run(cmd)