diff --git a/WORKSPACE b/WORKSPACE index 731c028ee..a87418d10 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -19,38 +19,38 @@ nixpkgs_package( nixpkgs_package( name = "hello", - repositories = { "nixpkgs": "//:nix/default.nix" } + repositories = { "nixpkgs": "//:nixpkgs.nix" } ) nixpkgs_package( name = "expr-test", nix_file_content = "let pkgs = import {}; in pkgs.hello", - repositories = { "nixpkgs": "//:nix/default.nix" } + repositories = { "nixpkgs": "//:nixpkgs.nix" } ) nixpkgs_package( name = "attribute-test", attribute_path = "hello", - repositories = { "nixpkgs": "//:nix/default.nix" } + repositories = { "nixpkgs": "//:nixpkgs.nix" } ) nixpkgs_package( name = "expr-attribute-test", nix_file_content = "import {}", attribute_path = "hello", - repositories = { "nixpkgs": "//:nix/default.nix" }, + repositories = { "nixpkgs": "//:nixpkgs.nix" }, ) nixpkgs_package( name = "nix-file-test", nix_file = "//tests:nixpkgs.nix", attribute_path = "hello", - repositories = { "nixpkgs": "//:nix/default.nix" }, + repositories = { "nixpkgs": "//:nixpkgs.nix" }, ) nixpkgs_package( name = "nix-file-deps-test", nix_file = "//tests:hello.nix", nix_file_deps = ["//tests:pkgname.nix"], - repositories = { "nixpkgs": "//:nix/default.nix" }, + repositories = { "nixpkgs": "//:nixpkgs.nix" }, ) diff --git a/nix/default.nix b/nixpkgs.nix similarity index 100% rename from nix/default.nix rename to nixpkgs.nix diff --git a/nixpkgs/nixpkgs.bzl b/nixpkgs/nixpkgs.bzl index f1e73b2a6..f63730886 100644 --- a/nixpkgs/nixpkgs.bzl +++ b/nixpkgs/nixpkgs.bzl @@ -79,12 +79,9 @@ def _nixpkgs_package_impl(ctx): # unless a pinned nixpkgs is set in the `nix_file` attribute. nix_path = "" if repositories: - # XXX Another hack: the repository label typically resolves to - # some top-level package in the external workspace. So we use - # dirname to get the actual workspace path. nix_path = ":".join( - [(path_name + "=" + str(ctx.path(path).dirname)) - for (path, path_name) in repositories.items()]) + [(path_name + "=" + str(ctx.path(target))) + for (target, path_name) in repositories.items()]) elif not (ctx.attr.nix_file or ctx.attr.nix_file_content): fail(strFailureImplicitNixpkgs) diff --git a/shell.nix b/shell.nix index 19d33dff5..23b3e10da 100644 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,4 @@ -{ pkgs ? import ./nix/default.nix {} }: +{ pkgs ? import ./nixpkgs.nix {} }: with pkgs;