diff --git a/pkgs/clan-cli/clan_cli/nix/__init__.py b/pkgs/clan-cli/clan_cli/nix/__init__.py index 9a54f960c..6ac7243ac 100644 --- a/pkgs/clan-cli/clan_cli/nix/__init__.py +++ b/pkgs/clan-cli/clan_cli/nix/__init__.py @@ -44,8 +44,9 @@ def nix_build(flags: list[str], gcroot: Path | None = None) -> list[str]: def nix_add_to_gcroots(nix_path: Path, dest: Path) -> None: - cmd = ["nix-store", "--realise", f"{nix_path}", "--add-root", f"{dest}"] - run(cmd) + if not os.environ.get("IN_NIX_SANDBOX"): + cmd = ["nix-store", "--realise", f"{nix_path}", "--add-root", f"{dest}"] + run(cmd) def nix_config() -> dict[str, Any]: