@@ -28,6 +28,12 @@ let
28 # because cabal will end up ignoring that built version;
28 # because cabal will end up ignoring that built version;
29 removeSelected = lib.filter
29 removeSelected = lib.filter
30 (input: lib.all (cfg: (input.identifier or null) != cfg.identifier) selected);
30 (input: lib.all (cfg: (input.identifier or null) != cfg.identifier) selected);
31+ # Also since a will include the library component of b in its buildInputs
32+ # (to make `propagatedBuildInputs` of `pkgconfig-depends` work) those should
33+ # also be excluded (the pkgconfig depends of b will still be included in the
34+ # system shells buildInputs via b's own buildInputs).
35+ removeSelectedInputs = lib.filter
36+ (input: lib.all (cfg: input != cfg.components.library or null) selected);
32 packageInputs = removeSelected
38 packageInputs = removeSelected
33 (lib.concatMap (cfg: cfg.depends) selectedConfigs
39 (lib.concatMap (cfg: cfg.depends) selectedConfigs
@@ -37,7 +43,7 @@ let
38 # Add the system libraries and build tools of the selected haskell
44 # Add the system libraries and build tools of the selected haskell
39 # packages to the shell.
45 # packages to the shell.
40− systemInputs = lib.concatMap (p: p.components.all.buildInputs) selected;
46+ systemInputs = removeSelectedInputs (lib.concatMap (p: p.components.all.buildInputs) selected);
41 nativeBuildInputs = removeSelected
47 nativeBuildInputs = removeSelected
42 (lib.concatMap (p: p.components.all.executableToolDepends) selected);
48 (lib.concatMap (p: p.components.all.executableToolDepends) selected);