cli: use nixpkgs in nix shell in pure mode
This avoids nixpkgs config and overlay provided by the user. Also enables caching in nix.
This commit is contained in:
@@ -6,4 +6,5 @@ def nix_shell(packages: list[str], cmd: list[str]) -> list[str]:
|
|||||||
# in unittest we will have all binaries provided
|
# in unittest we will have all binaries provided
|
||||||
if nixpkgs is None:
|
if nixpkgs is None:
|
||||||
return cmd
|
return cmd
|
||||||
return ["nix", "shell", "-f", nixpkgs] + packages + ["-c"] + cmd
|
wrapped_packages = [f"path:{nixpkgs}#{p}" for p in packages]
|
||||||
|
return ["nix", "shell"] + wrapped_packages + ["-c"] + cmd
|
||||||
|
|||||||
@@ -39,10 +39,8 @@ def test_ssh_no_pass(fp: pytest_subprocess.fake_process.FakeProcess) -> None:
|
|||||||
cmd: list[Union[str, utils.Any]] = [
|
cmd: list[Union[str, utils.Any]] = [
|
||||||
"nix",
|
"nix",
|
||||||
"shell",
|
"shell",
|
||||||
"-f",
|
"path:/mocked-nixpkgs#tor",
|
||||||
"/mocked-nixpkgs",
|
"path:/mocked-nixpkgs#openssh",
|
||||||
"tor",
|
|
||||||
"openssh",
|
|
||||||
"-c",
|
"-c",
|
||||||
"torify",
|
"torify",
|
||||||
"ssh",
|
"ssh",
|
||||||
@@ -68,11 +66,9 @@ def test_ssh_with_pass(fp: pytest_subprocess.fake_process.FakeProcess) -> None:
|
|||||||
cmd: list[Union[str, utils.Any]] = [
|
cmd: list[Union[str, utils.Any]] = [
|
||||||
"nix",
|
"nix",
|
||||||
"shell",
|
"shell",
|
||||||
"-f",
|
"path:/mocked-nixpkgs#tor",
|
||||||
"/mocked-nixpkgs",
|
"path:/mocked-nixpkgs#openssh",
|
||||||
"tor",
|
"path:/mocked-nixpkgs#sshpass",
|
||||||
"openssh",
|
|
||||||
"sshpass",
|
|
||||||
"-c",
|
"-c",
|
||||||
"torify",
|
"torify",
|
||||||
"sshpass",
|
"sshpass",
|
||||||
|
|||||||
Reference in New Issue
Block a user