prefix nixpkgs# explicitly in nix_shell

This makes the function usage less confusing (you can now tell from the call side what are flags and what is passed to nix-shell) and allows to use different flakes to download packages.
This commit is contained in:
Jörg Thalheim
2023-12-08 15:00:11 +01:00
parent af3001a3ac
commit 0e91f8721f
12 changed files with 45 additions and 39 deletions

View File

@@ -88,16 +88,15 @@ def nix_shell(packages: list[str], cmd: list[str]) -> list[str]:
# in our tests we just make sure we have all the packages
if os.environ.get("IN_NIX_SANDBOX"):
return cmd
wrapped_packages = [f"nixpkgs#{p}" for p in packages]
return (
nix_command(
return [
*nix_command(
[
"shell",
"--inputs-from",
f"{nixpkgs_flake()!s}",
]
)
+ wrapped_packages
+ ["-c"]
+ cmd
)
),
*packages,
"-c",
*cmd,
]