Skip to content

Commit 74f4683

Browse files
committed
Allow repository rule to check for sha
1 parent 7e455ad commit 74f4683

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

WORKSPACE

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ load("//nixpkgs:nixpkgs.bzl", "nixpkgs_git_repository", "nixpkgs_package")
77
nixpkgs_git_repository(
88
name = "nixpkgs",
99
revision = "17.09",
10+
sha256 = "405f1d6ba523630c83fbabef93f0da11ea388510a576adf2ded26a744fbf793e",
1011
)
1112

1213
nixpkgs_package(name = "hello", repository = "@nixpkgs")

nixpkgs/nixpkgs.bzl

+2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ def _nixpkgs_git_repository_impl(ctx):
77
ctx.download_and_extract(
88
url = "https://github.com/NixOS/nixpkgs/archive/%s.tar.gz" % ctx.attr.revision,
99
stripPrefix = "nixpkgs-" + ctx.attr.revision,
10+
sha256 = ctx.attr.sha256,
1011
)
1112

1213
nixpkgs_git_repository = repository_rule(
1314
implementation = _nixpkgs_git_repository_impl,
1415
attrs = {
1516
"revision": attr.string(),
17+
"sha256": attr.string(),
1618
},
1719
local = False,
1820
)

0 commit comments

Comments
 (0)