From 06fc8321370afb1aaf227196669893df35bfccea Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Mon, 28 Oct 2019 17:40:26 +0100 Subject: [PATCH] nixpkgs_local_repository: copy nix_file_deps And preserve the relative path to the repository root. --- nixpkgs/nixpkgs.bzl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nixpkgs/nixpkgs.bzl b/nixpkgs/nixpkgs.bzl index a3d23d3b..4bac218c 100644 --- a/nixpkgs/nixpkgs.bzl +++ b/nixpkgs/nixpkgs.bzl @@ -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,