From 567b8713dd10e467765624683aa41a44b7110a4e Mon Sep 17 00:00:00 2001 From: Guillaume Maudoux Date: Tue, 8 Oct 2024 11:24:27 +0200 Subject: [PATCH] Add a way to access the output_path in generated BUILD files --- core/nixpkgs.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/nixpkgs.bzl b/core/nixpkgs.bzl index 46f05bda..bc4190b6 100644 --- a/core/nixpkgs.bzl +++ b/core/nixpkgs.bzl @@ -478,7 +478,7 @@ def _nixpkgs_build_and_symlink(repository_ctx, nix_build_cmd, expr_args, build_f # provided by `build_file` or `build_file_content`. if not repository_ctx.path("BUILD").exists and not repository_ctx.path("BUILD.bazel").exists: if build_file_content: - repository_ctx.file("BUILD", content = build_file_content) + repository_ctx.file("BUILD", content = build_file_content.replace("{{NIX_STORE_PATH}}", output_path)) else: repository_ctx.template("BUILD", Label("@rules_nixpkgs_core//:BUILD.bazel.tpl")) elif build_file_content: