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

@@ -18,7 +18,7 @@ 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.machines.machines import Machine
from clan_cli.nix import nix_shell_legacy
from clan_cli.nix import nix_shell
from .check import check_secrets
from .public_modules import FactStoreBase
@@ -39,10 +39,10 @@ def read_multiline_input(prompt: str = "Finish with Ctrl-D") -> str:
def bubblewrap_cmd(generator: str, facts_dir: Path, secrets_dir: Path) -> list[str]:
# fmt: off
return nix_shell_legacy(
return nix_shell(
[
"nixpkgs#bash",
"nixpkgs#bubblewrap",
"bash",
"bubblewrap",
],
[
"bwrap",

View File

@@ -5,7 +5,7 @@ from typing import override
from clan_cli.cmd import Log, RunOpts
from clan_cli.machines.machines import Machine
from clan_cli.nix import nix_shell_legacy
from clan_cli.nix import nix_shell
from . import SecretStoreBase
@@ -18,8 +18,8 @@ class SecretStore(SecretStoreBase):
self, service: str, name: str, value: bytes, groups: list[str]
) -> Path | None:
subprocess.run(
nix_shell_legacy(
["nixpkgs#pass"],
nix_shell(
["pass"],
["pass", "insert", "-m", f"machines/{self.machine.name}/{name}"],
),
input=value,
@@ -29,8 +29,8 @@ class SecretStore(SecretStoreBase):
def get(self, service: str, name: str) -> bytes:
return subprocess.run(
nix_shell_legacy(
["nixpkgs#pass"],
nix_shell(
["pass"],
["pass", "show", f"machines/{self.machine.name}/{name}"],
),
check=True,
@@ -51,8 +51,8 @@ class SecretStore(SecretStoreBase):
hashes = []
hashes.append(
subprocess.run(
nix_shell_legacy(
["nixpkgs#git"],
nix_shell(
["git"],
[
"git",
"-C",
@@ -71,8 +71,8 @@ class SecretStore(SecretStoreBase):
if symlink.is_symlink():
hashes.append(
subprocess.run(
nix_shell_legacy(
["nixpkgs#git"],
nix_shell(
["git"],
[
"git",
"-C",