@@ -174,9 +174,12 @@ let
174174
175175 prePatch = if (cabalFile != null)
176176 then ''cat ${cabalFile} > ${package.identifier.name}.cabal''
177− else lib.optionalString (cabal-generator == "hpack") ''
178− ${buildPackages.haskell-nix.nix-tools.${compiler.nix-name}}/bin/hpack
179− '';
177+ else
178+ # When building hpack package we use the internal nix-tools
179+ # (compiled with a fixed GHC version)
180+ lib.optionalString (cabal-generator == "hpack") ''
181+ ${buildPackages.haskell-nix.internal-nix-tools}/bin/hpack
182+ '';
180183 }
181184 # patches can (if they like) depend on the version and revision of the package.
182185 // lib.optionalAttrs (patches != []) {