cli: resolve CLAN_NIXPKGS on every invocation
this makes mocking easier
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import os
|
||||
|
||||
CLAN_NIXPKGS = os.environ.get("CLAN_NIXPKGS")
|
||||
|
||||
|
||||
def nix_shell(packages: list[str], cmd: list[str]) -> list[str]:
|
||||
nixpkgs = os.environ.get("CLAN_NIXPKGS")
|
||||
# in unittest we will have all binaries provided
|
||||
if CLAN_NIXPKGS is None:
|
||||
if nixpkgs is None:
|
||||
return cmd
|
||||
return ["nix", "shell", "-f", CLAN_NIXPKGS] + packages + ["-c"] + cmd
|
||||
return ["nix", "shell", "-f", nixpkgs] + packages + ["-c"] + cmd
|
||||
|
||||
Reference in New Issue
Block a user