vars: make all python tests work in nix sandbox

- generate a flake.lock file for each template by copying the clan-core flake.lock and modifying it

- call nix build with --store for tests inside the sandbox
This commit is contained in:
DavHau
2024-11-27 14:31:34 +07:00
parent 01813f36e1
commit 44e6fe803f
10 changed files with 170 additions and 60 deletions

View File

@@ -10,7 +10,11 @@ from clan_cli.errors import ClanError
def nix_command(flags: list[str]) -> list[str]:
return ["nix", "--extra-experimental-features", "nix-command flakes", *flags]
args = ["nix", "--extra-experimental-features", "nix-command flakes", *flags]
store = os.environ.get("TMP_STORE", None)
if store:
args += ["--store", store]
return args
def nix_flake_show(flake_url: str | Path) -> list[str]: