Fix locking
This commit is contained in:
committed by
clan-bot
parent
014aec9531
commit
cb89fb0847
@@ -3,6 +3,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
from clan_cli.locked_open import locked_open
|
||||||
|
|
||||||
from clan_cli.cmd import run, run_no_stdout
|
from clan_cli.cmd import run, run_no_stdout
|
||||||
from clan_cli.dirs import nixpkgs_flake, nixpkgs_source
|
from clan_cli.dirs import nixpkgs_flake, nixpkgs_source
|
||||||
@@ -60,11 +61,12 @@ def nix_config() -> dict[str, Any]:
|
|||||||
|
|
||||||
|
|
||||||
def nix_test_store() -> Path | None:
|
def nix_test_store() -> Path | None:
|
||||||
|
store = os.environ.get("CLAN_TEST_STORE", None)
|
||||||
if not os.environ.get("IN_NIX_SANDBOX"):
|
if not os.environ.get("IN_NIX_SANDBOX"):
|
||||||
return None
|
return None
|
||||||
store = os.environ.get("CLAN_TEST_STORE", None)
|
|
||||||
if store:
|
if store:
|
||||||
return Path(store)
|
with locked_open(Path(store) / "lockfile"):
|
||||||
|
return Path(store)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user