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 4b9a0d8c19
commit 2240a3a533
24 changed files with 69 additions and 65 deletions

View File

@@ -14,7 +14,7 @@ from clan_cli.completions import (
)
from clan_cli.errors import ClanError
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.host import Host, is_ssh_reachable
from clan_cli.ssh.host_key import HostKeyCheck
from clan_cli.ssh.parse import parse_deployment_address
@@ -65,7 +65,7 @@ def find_reachable_host(
def qrcode_scan(picture_file: Path) -> str:
cmd = nix_shell(
cmd = nix_shell_legacy(
["nixpkgs#zbar"],
[
"zbarimg",

View File

@@ -12,7 +12,7 @@ from typing import Any
from clan_cli.cmd import CmdOut, RunOpts, run
from clan_cli.colors import AnsiColor
from clan_cli.errors import ClanError
from clan_cli.nix import run_cmd
from clan_cli.nix import nix_shell
from clan_cli.ssh.host_key import HostKeyCheck
cmdlog = logging.getLogger(__name__)
@@ -216,7 +216,7 @@ class Host:
*ssh_opts,
]
return run_cmd(packages, cmd)
return nix_shell(packages, cmd)
def connect_ssh_shell(
self, *, password: str | None = None, tor_socks: bool = False

View File

@@ -10,7 +10,7 @@ from dataclasses import dataclass
from clan_cli.async_run import AsyncRuntime
from clan_cli.cmd import Log, RunOpts, run
from clan_cli.errors import TorConnectionError, TorSocksError
from clan_cli.nix import nix_shell
from clan_cli.nix import nix_shell_legacy
log = logging.getLogger(__name__)
@@ -117,7 +117,7 @@ def spawn_tor(runtime: AsyncRuntime) -> None:
"""Starts Tor process using nix-shell."""
cmd_args = ["tor", "--HardwareAccel", "1"]
packages = ["nixpkgs#tor"]
cmd = nix_shell(packages, cmd_args)
cmd = nix_shell_legacy(packages, cmd_args)
runtime.async_run(None, run, cmd, RunOpts(log=Log.BOTH))
log.debug("Attempting to start Tor")