clan-lib: Remove duplicate fields from installOptions and instead use them from Remote
This commit is contained in:
@@ -30,9 +30,6 @@ class InstallOptions:
|
||||
phases: str | None = None
|
||||
build_on: BuildOn | None = None
|
||||
update_hardware_config: HardwareConfig = HardwareConfig.NONE
|
||||
password: str | None = None
|
||||
identity_file: Path | None = None
|
||||
use_tor: bool = False
|
||||
|
||||
|
||||
@API.register
|
||||
@@ -72,8 +69,8 @@ def run_machine_install(opts: InstallOptions, target_host: Remote) -> None:
|
||||
machine.name, partitioning_secrets, phases=["partitioning"]
|
||||
)
|
||||
|
||||
if opts.password:
|
||||
os.environ["SSHPASS"] = opts.password
|
||||
if target_host.password:
|
||||
os.environ["SSHPASS"] = target_host.password
|
||||
|
||||
cmd = [
|
||||
"nixos-anywhere",
|
||||
@@ -111,15 +108,15 @@ def run_machine_install(opts: InstallOptions, target_host: Remote) -> None:
|
||||
]
|
||||
)
|
||||
|
||||
if opts.password:
|
||||
if target_host.password:
|
||||
cmd += [
|
||||
"--env-password",
|
||||
"--ssh-option",
|
||||
"IdentitiesOnly=yes",
|
||||
]
|
||||
|
||||
if opts.identity_file:
|
||||
cmd += ["-i", str(opts.identity_file)]
|
||||
if target_host.private_key:
|
||||
cmd += ["-i", str(target_host.private_key)]
|
||||
|
||||
if opts.build_on:
|
||||
cmd += ["--build-on", opts.build_on]
|
||||
@@ -136,7 +133,7 @@ def run_machine_install(opts: InstallOptions, target_host: Remote) -> None:
|
||||
cmd.extend(opts.machine.flake.nix_options or [])
|
||||
|
||||
cmd.append(target_host.target)
|
||||
if opts.use_tor:
|
||||
if target_host.tor_socks:
|
||||
# nix copy does not support tor socks proxy
|
||||
# cmd.append("--ssh-option")
|
||||
# cmd.append("ProxyCommand=nc -x 127.0.0.1:9050 -X 5 %h %p")
|
||||
|
||||
Reference in New Issue
Block a user