File tree 3 files changed +21
-2
lines changed
3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 15
15
, withHoogle ? true
16
16
, withHaddock ? withHoogle
17
17
, exactDeps ? false
18
+ , allToolDeps ? ! exactDeps
18
19
, tools ? { }
19
20
, packageSetupDeps ? true
20
21
, enableDWARF ? false
109
110
nativeBuildInputs = removeSelectedInputs
110
111
( uniqueWithName ( lib . concatMap ( c : c . executableToolDepends )
111
112
# When not using `exactDeps` cabal may try to build arbitrary dependencies
112
- # so in this case we need to provide the build tools for all of hsPkgs:
113
- ( if exactDeps then selectedComponents else allHsPkgsComponents ) ) ) ;
113
+ # so in this case we need to provide the build tools for all of `hsPkgs`.
114
+ # In some cases those tools may be unwanted or broken so the `allToolDeps`
115
+ # flag can be set to `false` to disable this (stack projects default `allToolDeps`
116
+ # to `false` as `hsPkgs` for them includes all of stackage):
117
+ ( if exactDeps || ! allToolDeps then selectedComponents else allHsPkgsComponents ) ) ) ;
114
118
115
119
# Set up a "dummy" component to use with ghcForComponent.
116
120
component = {
Original file line number Diff line number Diff line change 29
29
type = lib . types . bool ;
30
30
default = false ;
31
31
} ;
32
+ allToolDeps = lib . mkOption {
33
+ type = lib . types . bool ;
34
+ default = ! config . exactDeps ;
35
+ description = ''
36
+ Indicates if the shell should include all the tool dependencies
37
+ of in the haskell packages in the project. Defaulted to `false` in
38
+ stack projects (to avoid trying to build the tools used by
39
+ every `stackage` package).
40
+ '' ;
41
+ } ;
32
42
tools = lib . mkOption {
33
43
type = lib . types . attrsOf lib . types . unspecified ;
34
44
default = { } ;
Original file line number Diff line number Diff line change @@ -91,4 +91,9 @@ with types;
91
91
description = "Deprecated in favour of `compiler-nix-name`" ;
92
92
} ;
93
93
} ;
94
+ config = {
95
+ # For stack projects we normally do not want to include the tool dependencies
96
+ # of all the hsPkgs (all of stackage).
97
+ shell . allToolDeps = mkDefault false ;
98
+ } ;
94
99
}
You can’t perform that action at this time.
0 commit comments