clan-core/pkgs/clan-cli/clan_cli/nix.py
Jörg Thalheim 09cc79867d
All checks were successful
build / test (push) Successful in 10s
cli: get optional deps from our own flake
This ensures we actually test if all those binaries build
2023-07-26 09:31:49 +02:00

11 lines
337 B
Python

import os
def nix_shell(packages: list[str], cmd: list[str]) -> list[str]:
flake = os.environ.get("CLAN_FLAKE")
# in unittest we will have all binaries provided
if flake is None:
return cmd
wrapped_packages = [f"path:{flake}#{p}" for p in packages]
return ["nix", "shell"] + wrapped_packages + ["-c"] + cmd