cli: get optional deps from our own flake
This ensures we actually test if all those binaries build
This commit is contained in:
@@ -2,9 +2,9 @@ import os
|
||||
|
||||
|
||||
def nix_shell(packages: list[str], cmd: list[str]) -> list[str]:
|
||||
nixpkgs = os.environ.get("CLAN_NIXPKGS")
|
||||
flake = os.environ.get("CLAN_FLAKE")
|
||||
# in unittest we will have all binaries provided
|
||||
if nixpkgs is None:
|
||||
if flake is None:
|
||||
return cmd
|
||||
wrapped_packages = [f"path:{nixpkgs}#{p}" for p in packages]
|
||||
wrapped_packages = [f"path:{flake}#{p}" for p in packages]
|
||||
return ["nix", "shell"] + wrapped_packages + ["-c"] + cmd
|
||||
|
||||
@@ -86,8 +86,9 @@ class ZerotierController:
|
||||
def zerotier_controller() -> Iterator[ZerotierController]:
|
||||
# This check could be racy but it's unlikely in practice
|
||||
controller_port = find_free_port(range(10000, 65535))
|
||||
cmd = nix_shell(["bash", "zerotierone"], ["bash", "-c", "command -v zerotier-one"])
|
||||
res = subprocess.run(
|
||||
nix_shell(["bash", "zerotierone"], ["bash", "-c", "command -v zerotier-one"]),
|
||||
cmd,
|
||||
check=True,
|
||||
text=True,
|
||||
stdout=subprocess.PIPE,
|
||||
|
||||
Reference in New Issue
Block a user