diff --git a/core/nixpkgs.bzl b/core/nixpkgs.bzl index fcc20aa69..62d5bd75a 100644 --- a/core/nixpkgs.bzl +++ b/core/nixpkgs.bzl @@ -482,17 +482,17 @@ def _nixpkgs_package_impl(repository_ctx): nix_file = cp(repository_ctx, repository_ctx.attr.nix_file) default_nix_substs = { "%{def}": "import /${\"%s\"}" % repository_ctx.path(nix_file), - "%{maybe_attr}": (".%s" % attribute_path) if attribute_path else "", + "%{maybe_attr}": (".\"${%s}\"" % attribute_path) if attribute_path else "", } elif repository_ctx.attr.nix_file_content: default_nix_substs = { "%{def}": repository_ctx.attr.nix_file_content, - "%{maybe_attr}": (".%s" % attribute_path) if attribute_path else "", + "%{maybe_attr}": (".\"${%s}\"" % attribute_path) if attribute_path else "", } else: default_nix_substs = { "%{def}": "import { config = {}; overlays = []; }", - "%{maybe_attr}": ".%s" % (attribute_path or repository_ctx.attr.name), + "%{maybe_attr}": ".\"${%s}\"" % (attribute_path or repository_ctx.attr.name), } nix_file_deps = {}