rename nix_shell_legacy to nix_shell and run_cmd to nix_shell

Than it's more obvious that we need to migrate.
This commit is contained in:
Jörg Thalheim
2025-04-16 19:57:13 +02:00
committed by Mic92
parent ed123d2332
commit 837789010e
24 changed files with 69 additions and 65 deletions

View File

@@ -13,7 +13,7 @@ from clan_cli.errors import ClanCmdError, ClanError
from clan_cli.flake import Flake
from clan_cli.git import commit_file
from clan_cli.machines.machines import Machine
from clan_cli.nix import nix_config, nix_eval, run_cmd
from clan_cli.nix import nix_config, nix_eval, nix_shell
from .types import machine_name_type
@@ -144,7 +144,7 @@ def generate_machine_hardware_info(opts: HardwareGenerateOptions) -> HardwareCon
if opts.password:
deps += ["sshpass"]
cmd = run_cmd(
cmd = nix_shell(
deps,
[
*(["sshpass", "-p", opts.password] if opts.password else []),

View File

@@ -18,7 +18,7 @@ from clan_cli.errors import ClanError
from clan_cli.facts.generate import generate_facts
from clan_cli.machines.hardware import HardwareConfig
from clan_cli.machines.machines import Machine
from clan_cli.nix import nix_shell
from clan_cli.nix import nix_shell_legacy
from clan_cli.ssh.deploy_info import DeployInfo, find_reachable_host, ssh_command_parse
from clan_cli.ssh.host_key import HostKeyCheck
from clan_cli.vars.generate import generate_vars
@@ -146,7 +146,7 @@ def install_machine(opts: InstallOptions) -> None:
# cmd.append("--ssh-option")
# cmd.append("ProxyCommand=nc -x 127.0.0.1:9050 -X 5 %h %p")
run(
nix_shell(
nix_shell_legacy(
[
"nixpkgs#nixos-anywhere",
"nixpkgs#tor",
@@ -157,7 +157,7 @@ def install_machine(opts: InstallOptions) -> None:
)
else:
run(
nix_shell(
nix_shell_legacy(
["nixpkgs#nixos-anywhere"],
cmd,
),

View File

@@ -20,7 +20,7 @@ from clan_cli.inventory import (
patch_inventory_with,
)
from clan_cli.machines.hardware import HardwareConfig
from clan_cli.nix import nix_eval, nix_shell
from clan_cli.nix import nix_eval, nix_shell_legacy
from clan_cli.tags import list_nixos_machines_by_tags
log = logging.getLogger(__name__)
@@ -126,7 +126,7 @@ def check_machine_online(
timeout = opts.timeout if opts and opts.timeout else 20
cmd = nix_shell(
cmd = nix_shell_legacy(
["nixpkgs#util-linux", *(["nixpkgs#openssh"] if hostname else [])],
[
"ssh",