@@ -76,6 +76,18 @@ self: super: {
7676 inherit hackage pkg-def;
7777 });
7878
79+ # Some boot packages (libiserv) are in lts, but not in hackage,
80+ # so we should not try to get it from hackage based on the stackage
81+ # info. Instead we can add ghc-boot-packages to `pkg-def-extras`.
82+ excludeBootPackages = pkg-def: hackage:
83+ let original = pkg-def hackage;
84+ bootPkgNames = self.lib.attrNames
85+ self.ghc-boot-packages.${(pkg-def hackage).compiler.nix-name};
86+ in original // {
87+ packages = self.lib.filterAttrs (n: _: self.lib.all (b: n != b) bootPkgNames)
88+ original.packages;
89+ };
90+
7991 # Create a Haskell package set based on a Stack configuration.
8092 mkStackPkgSet =
8193 { stack-pkgs # Path to the output of stack-to-nix
@@ -92,7 +104,7 @@ self: super: {
92104 compiler = (stack-pkgs.extras hackage).compiler or (pkg-def hackage).compiler;
93105 patchesModule = ghcHackagePatches.${compiler.nix-name} or {};
94106 in mkPkgSet {
95− inherit pkg-def;
107+ pkg-def = excludeBootPackages pkg-def;
96108 pkg-def-extras = [ stack-pkgs.extras
97109 self.ghc-boot-packages.${compiler.nix-name}
98110 ]
@@ -130,7 +142,7 @@ self: super: {
130142 };
131143
132144 # Package sets for all stackage snapshots.
133− snapshots = import ../snapshots.nix { inherit (self) lib ghc-boot-packages; inherit mkPkgSet stackage; };
145+ snapshots = import ../snapshots.nix { inherit (self) lib ghc-boot-packages; inherit mkPkgSet stackage excludeBootPackages; };
134146 # Pick a recent LTS snapshot to be our "default" package set.
135147 haskellPackages = snapshots."lts-14.13";
136148