diff --git a/pkgs/clan-cli/clan_cli/nix.py b/pkgs/clan-cli/clan_cli/nix.py index f8d3c89a4..ab585abb3 100644 --- a/pkgs/clan-cli/clan_cli/nix.py +++ b/pkgs/clan-cli/clan_cli/nix.py @@ -6,4 +6,5 @@ def nix_shell(packages: list[str], cmd: list[str]) -> list[str]: # in unittest we will have all binaries provided if nixpkgs is None: 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 diff --git a/pkgs/clan-cli/tests/test_clan_ssh.py b/pkgs/clan-cli/tests/test_clan_ssh.py index de42ca119..897d53057 100644 --- a/pkgs/clan-cli/tests/test_clan_ssh.py +++ b/pkgs/clan-cli/tests/test_clan_ssh.py @@ -39,10 +39,8 @@ def test_ssh_no_pass(fp: pytest_subprocess.fake_process.FakeProcess) -> None: cmd: list[Union[str, utils.Any]] = [ "nix", "shell", - "-f", - "/mocked-nixpkgs", - "tor", - "openssh", + "path:/mocked-nixpkgs#tor", + "path:/mocked-nixpkgs#openssh", "-c", "torify", "ssh", @@ -68,11 +66,9 @@ def test_ssh_with_pass(fp: pytest_subprocess.fake_process.FakeProcess) -> None: cmd: list[Union[str, utils.Any]] = [ "nix", "shell", - "-f", - "/mocked-nixpkgs", - "tor", - "openssh", - "sshpass", + "path:/mocked-nixpkgs#tor", + "path:/mocked-nixpkgs#openssh", + "path:/mocked-nixpkgs#sshpass", "-c", "torify", "sshpass",