hardware: only include sshpass if we are actually using it.
This commit is contained in:
@@ -140,11 +140,12 @@ def generate_machine_hardware_info(opts: HardwareGenerateOptions) -> HardwareCon
|
|||||||
if host.user != "root":
|
if host.user != "root":
|
||||||
config_command.insert(0, "sudo")
|
config_command.insert(0, "sudo")
|
||||||
|
|
||||||
|
deps = ["nixpkgs#openssh"]
|
||||||
|
if opts.password:
|
||||||
|
deps += ["nixpkgs#sshpass"]
|
||||||
|
|
||||||
cmd = nix_shell(
|
cmd = nix_shell(
|
||||||
[
|
deps,
|
||||||
"nixpkgs#openssh",
|
|
||||||
"nixpkgs#sshpass",
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
*(["sshpass", "-p", opts.password] if opts.password else []),
|
*(["sshpass", "-p", opts.password] if opts.password else []),
|
||||||
"ssh",
|
"ssh",
|
||||||
|
|||||||
Reference in New Issue
Block a user