Revert "clan-cli: deprecate nix_shell() in favor of run_cmd()"

This reverts commit 37e6ca7a30.
This commit is contained in:
Jörg Thalheim
2024-07-17 14:04:49 +02:00
parent 55fc9dd00d
commit 0d6e2539e3
24 changed files with 116 additions and 104 deletions

View File

@@ -6,7 +6,7 @@ import socket
import subprocess
from pathlib import Path
from ..nix import run_cmd
from ..nix import nix_shell
log = logging.getLogger(__name__)
@@ -18,13 +18,13 @@ def ssh(
ssh_args: list[str] = [],
torify: bool = False,
) -> None:
packages = ["openssh"]
packages = ["nixpkgs#openssh"]
if torify:
packages.append("tor")
packages.append("nixpkgs#tor")
password_args = []
if password:
packages.append("sshpass")
packages.append("nixpkgs#sshpass")
password_args = [
"sshpass",
"-p",
@@ -48,15 +48,15 @@ def ssh(
if torify:
cmd_args.insert(0, "torify")
cmd = run_cmd(packages, cmd_args)
cmd = nix_shell(packages, cmd_args)
subprocess.run(cmd)
def qrcode_scan(picture_file: str) -> str:
return (
subprocess.run(
run_cmd(
["zbar"],
nix_shell(
["nixpkgs#zbar"],
[
"zbarimg",
"--quiet",