@@ -9,7 +9,7 @@
99 # in the selected packages. If only as subset of the components will be
1010 # worked on in the shell then we can pass a different `components` function
1111 # to select those.
12−, components ? ps: lib.concatMap haskellLib.getAllComponents (packages hsPkgs)
12+, components ? ps: lib.concatMap haskellLib.getAllComponents (packages ps)
1313 # Additional packages to be added unconditionally
1414, additional ? _: []
1515, withHoogle ? true
@@ -50,26 +50,20 @@ let
5050 # We have to do this slightly differently because we will be looking at the actual components rather
5151 # than the packages.
5252
53− # Given a list of packages, removes those which were selected as part of the shell.
54− # We do this on the basis of their identifiers being the same, not direct equality (why?).
55− removeSelectedPackages =
56− # All the identifiers of the selected packages
57− let selectedPackageIds = map (p: p.identifier) selectedPackages;
58− in lib.filter (input: !(builtins.elem (input.identifier or null) selectedPackageIds));
59−
60− # Given a list of derivations, removes those which are components of packages which were selected as part of the shell.
53+ # Given a list of `depends`, removes those which are components of packages which were selected as part of the shell.
6154 removeSelectedInputs =
6255 # All the components of the selected packages: we shouldn't add any of these as dependencies
63− let selectedPackageComponents = map (x: x.name) (lib.concatMap haskellLib.getAllComponents selectedPackages);
64− in lib.filter (input: !(builtins.elem input.name selectedPackageComponents));
56+ let selectedPackageComponents = map (x: x.name) selectedComponents;
57+ in lib.filter (input:
58+ !(builtins.elem ((haskellLib.dependToLib input).name or null) selectedPackageComponents));
6559
6660 # We need to remove any dependencies which are selected packages (see above).
67− # `depends` contains packages so we use 'removeSelectedPackages`.
68− packageInputs = removeSelectedPackages (lib.concatMap (cfg: cfg.depends) selectedConfigs) ++ additionalPackages;
61+ packageInputs = removeSelectedInputs (lib.concatMap (cfg: cfg.depends) selectedConfigs)
62+ ++ additionalPackages;
6963
7064 # Add the system libraries and build tools of the selected haskell packages to the shell.
7165 # We need to remove any inputs which are selected components (see above).
72− # `buildInputs`, `propagatedBuildInputs`, and `executableToolDepends` contain component
66+ # `buildInputs`, `propagatedBuildInputs`, and `executableToolDepends` contain component
7367 # derivations, not packages, so we use `removeSelectedInputs`).
7468 systemInputs = removeSelectedInputs (lib.concatMap
7569 (c: c.buildInputs ++ c.propagatedBuildInputs) selectedComponents);
@@ -115,7 +109,7 @@ let
115109 }
116110 ));
117111
118− mkDrvArgs = builtins.removeAttrs args ["packages" "additional" "withHoogle" "tools"];
112+ mkDrvArgs = builtins.removeAttrs args ["packages" "components" "additional" "withHoogle" "tools"];
119113in
120114 mkShell (mkDrvArgs // {
121115 name = mkDrvArgs.name or name;