hardware: only include sshpass if we are actually using it.

This commit is contained in:
Jörg Thalheim
2025-04-09 08:34:37 +00:00
parent e25cd73e99
commit 326633d1b8

View File

@@ -140,11 +140,12 @@ def generate_machine_hardware_info(opts: HardwareGenerateOptions) -> HardwareCon
if host.user != "root":
config_command.insert(0, "sudo")
deps = ["nixpkgs#openssh"]
if opts.password:
deps += ["nixpkgs#sshpass"]
cmd = nix_shell(
[
"nixpkgs#openssh",
"nixpkgs#sshpass",
],
deps,
[
*(["sshpass", "-p", opts.password] if opts.password else []),
"ssh",