1- { lib , stdenv , mkShell , glibcLocales , ghcForComponent , makeConfigFiles , hsPkgs , hoogleLocal , haskellLib , pkgsBuildBuild , evalPackages , compiler } :
1+ { lib , stdenv , mkShell , glibcLocales , ghcForComponent , makeConfigFiles , hsPkgs , hoogleLocal , haskellLib , pkgsBuildBuild , evalPackages , compiler , haskell-nix , ghc } :
22
33{ # `packages` function selects packages that will be worked on in the shell itself.
44 # These packages will not be built by `shellFor`, but their
9393 ( removeSelectedInputs ( haskellLib . uniqueWithName ( lib . concatMap ( cfg : cfg . depends ) selectedConfigs ) )
9494 ++ additionalPackages ) ;
9595
96+ # For non haskell dependencies (and `pre-existing` haskell packages)
97+ # we want to search all the configs.
98+ allConfigs = selectedConfigs ++
99+ builtins . map ( x : ( haskellLib . dependToLib x ) . config ) additionalPackages ;
100+
96101 # Add the system libraries and build tools of the selected haskell packages to the shell.
97102 # We need to remove any inputs which are selected components (see above).
98103 # `buildInputs`, `propagatedBuildInputs`, and `executableToolDepends` contain component
@@ -115,10 +120,13 @@ let
115120 # Set up a "dummy" component to use with ghcForComponent.
116121 component = {
117122 depends = packageInputs ;
118- pre-existing = lib . concatMap ( x : ( haskellLib . dependToLib x ) . config . pre-existing or [ ] ) packageInputs ;
119- libs = lib . concatMap ( x : ( haskellLib . dependToLib x ) . config . libs or [ ] ) packageInputs ;
120- pkgconfig = lib . concatMap ( x : ( haskellLib . dependToLib x ) . config . pkgconfig or [ ] ) packageInputs ;
121- frameworks = lib . concatMap ( x : ( haskellLib . dependToLib x ) . config . frameworks or [ ] ) packageInputs ;
123+ pre-existing =
124+ if exactDeps
125+ then lib . unique ( lib . concatMap ( x : ( haskellLib . dependToLib x ) . pre-existing or [ ] ) allConfigs )
126+ else haskell-nix . ghc-pre-existing ghc ;
127+ libs = haskellLib . uniqueWithName ( lib . concatMap ( x : ( haskellLib . dependToLib x ) . libs or [ ] ) allConfigs ) ;
128+ pkgconfig = haskellLib . uniqueWithName ( lib . concatMap ( x : ( haskellLib . dependToLib x ) . pkgconfig or [ ] ) allConfigs ) ;
129+ frameworks = haskellLib . uniqueWithName ( lib . concatMap ( x : ( haskellLib . dependToLib x ) . frameworks or [ ] ) allConfigs ) ;
122130 doExactConfig = false ;
123131 } ;
124132 configFiles = makeConfigFiles {
0 commit comments