Reapply "remove nix_shell_legacy"

This reverts commit c5001f19fc.
This commit is contained in:
Jörg Thalheim
2025-04-21 13:03:25 +02:00
parent 7c57b853e6
commit 723d72255c
24 changed files with 91 additions and 119 deletions

View File

@@ -17,7 +17,7 @@ from clan_cli.completions import (
from clan_cli.errors import ClanError
from clan_cli.git import commit_files
from clan_cli.machines.inventory import get_all_machines, get_selected_machines
from clan_cli.nix import nix_config, nix_shell_legacy, nix_test_store
from clan_cli.nix import nix_config, nix_shell, nix_test_store
from clan_cli.vars._types import StoreBase
from .check import check_vars
@@ -84,10 +84,10 @@ def bubblewrap_cmd(generator: str, tmpdir: Path) -> list[str]:
test_store = nix_test_store()
# fmt: off
return nix_shell_legacy(
return nix_shell(
[
"nixpkgs#bash",
"nixpkgs#bubblewrap",
"bash",
"bubblewrap",
],
[
"bwrap",

View File

@@ -9,7 +9,7 @@ from tempfile import TemporaryDirectory
from clan_cli.cmd import CmdOut, Log, RunOpts, run
from clan_cli.machines.machines import Machine
from clan_cli.nix import nix_shell_legacy
from clan_cli.nix import nix_shell
from clan_cli.ssh.upload import upload
from clan_cli.vars._types import StoreBase
from clan_cli.vars.generate import Generator, Var
@@ -49,9 +49,7 @@ class SecretStore(StoreBase):
return Path(self.entry_prefix) / self.rel_dir(generator, name)
def _run_pass(self, *args: str, options: RunOpts | None = None) -> CmdOut:
cmd = nix_shell_legacy(
packages=["nixpkgs#pass"], cmd=[self._store_backend, *args]
)
cmd = nix_shell(packages=["pass"], cmd=[self._store_backend, *args])
return run(cmd, options)
def _set(
@@ -92,8 +90,8 @@ class SecretStore(StoreBase):
hashes = []
hashes.append(
run(
nix_shell_legacy(
["nixpkgs#git"],
nix_shell(
["git"],
[
"git",
"-C",
@@ -120,8 +118,8 @@ class SecretStore(StoreBase):
if symlink.is_symlink():
hashes.append(
run(
nix_shell_legacy(
["nixpkgs#git"],
nix_shell(
["git"],
[
"git",
"-C",