@@ -28,6 +28,12 @@ let
2828 # because cabal will end up ignoring that built version;
2929 removeSelected = lib.filter
3030 (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);
3137
3238 packageInputs = removeSelected
3339 (lib.concatMap (cfg: cfg.depends) selectedConfigs
@@ -37,7 +43,7 @@ let
3743
3844 # Add the system libraries and build tools of the selected haskell
3945 # 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);
4147 nativeBuildInputs = removeSelected
4248 (lib.concatMap (p: p.components.all.executableToolDepends) selected);
4349