File tree 1 file changed +13
-2
lines changed 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 13
13
if sha256map != null
14
14
then { location , tag , ...} : sha256map . "${ location } " . "${ tag } "
15
15
else _ : null
16
+ , branchMap ? null
17
+ # A way to specify in which branch a git commit can
18
+ # be found
19
+ , lookupBranch ?
20
+ if branchMap != null
21
+ then { location , tag , ...} : branchMap . "${ location } " . "${ tag } " or null
22
+ else _ : null
16
23
, resolverSha256 ? null
17
24
, nix-tools ? pkgs . haskell-nix . internal-nix-tools # When building stack projects we use the internal nix-tools (compiled with a fixed GHC version)
18
25
, ...
@@ -84,15 +91,19 @@ concatMap (dep:
84
91
location = dep . url ;
85
92
tag = dep . rev ;
86
93
} ;
94
+ branch = lookupBranch {
95
+ location = dep . url ;
96
+ tag = dep . rev ;
97
+ } ;
87
98
pkgsrc =
88
99
if ! is-private && sha256 != null
89
100
then pkgs . fetchgit {
90
101
inherit ( dep ) url rev ;
91
102
inherit sha256 ;
92
103
}
93
- else builtins . fetchGit {
104
+ else builtins . fetchGit ( {
94
105
inherit ( dep ) url rev ;
95
- } ;
106
+ } // pkgs . lib . optionalAttrs ( branch != null ) { ref = branch ; } ) ;
96
107
in map ( subdir : {
97
108
name = cabalName "${ pkgsrc } /${ subdir } " ;
98
109
inherit ( dep ) url rev ;
You can’t perform that action at this time.
0 commit comments