Skip to content

Commit

Permalink
nixpkgs_local_repository: copy nix_file_deps
Browse files Browse the repository at this point in the history
And preserve the relative path to the repository root.
  • Loading branch information
aherrmann committed Oct 28, 2019
1 parent 2980a2f commit 06fc832
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nixpkgs/nixpkgs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ def _nixpkgs_local_repository_impl(repository_ctx):
)
target = repository_ctx.path("default.nix")
else:
target = repository_ctx.path(repository_ctx.attr.nix_file)
_cp(repository_ctx, target, target.basename)
target = _cp(repository_ctx, repository_ctx.attr.nix_file)

for dep in repository_ctx.attr.nix_file_deps:
_cp(repository_ctx, dep)

# Make "@nixpkgs" (syntactic sugar for "@nixpkgs//:nixpkgs") a valid
# label for the target Nix file.
repository_ctx.symlink(target.basename, repository_ctx.name)
repository_ctx.symlink(target, repository_ctx.name)

nixpkgs_local_repository = repository_rule(
implementation = _nixpkgs_local_repository_impl,
Expand Down

0 comments on commit 06fc832

Please sign in to comment.