@@ -124,18 +124,22 @@ _nixpkgs_package = repository_rule(
124
124
local = True ,
125
125
)
126
126
127
- def nixpkgs_package (repositories , * args , ** kwargs ):
128
- # Because of https://github.com/bazelbuild/bazel/issues/5356 we can't
129
- # directly pass a dict from strings to labels to the rule (which we'd like
130
- # for the `repositories` arguments), but we can pass a dict from labels to
131
- # strings. So we swap the keys and the values (assuming they all are
132
- # distinct).
133
- inversed_repositories = { value : key for (key , value ) in repositories .items () }
127
+ def nixpkgs_package (* args , ** kwargs ):
128
+ # Because of https://github.com/bazelbuild/bazel/issues/5356 we can't
129
+ # directly pass a dict from strings to labels to the rule (which we'd like
130
+ # for the `repositories` arguments), but we can pass a dict from labels to
131
+ # strings. So we swap the keys and the values (assuming they all are
132
+ # distinct).
133
+ if "repositories" in kwargs :
134
+ inversed_repositories = { value : key for (key , value ) in kwargs ["repositories" ].items () }
135
+ kwargs .pop ("repositories" )
134
136
_nixpkgs_package (
135
- repositories = inversed_repositories ,
136
- * args ,
137
- ** kwargs
137
+ repositories = inversed_repositories ,
138
+ * args ,
139
+ ** kwargs
138
140
)
141
+ else :
142
+ _nixpkgs_package (* args , ** kwargs )
139
143
140
144
def _symlink_children (target_dir , rep_ctx ):
141
145
"""Create a symlink to all children of `target_dir` in the current
0 commit comments