@@ -88,6 +88,8 @@ let
88 ++ component.configureFlags
88 ++ component.configureFlags
91+ setupGhcOptions = lib.optional (package.ghcOptions != null) '' --ghc-options="${package.ghcOptions}"'';
91 executableToolDepends =
93 executableToolDepends =
92 (lib.concatMap (c: if c.isHaskell or false
94 (lib.concatMap (c: if c.isHaskell or false
93 then builtins.attrValues (c.components.exes or {})
95 then builtins.attrValues (c.components.exes or {})
@@ -190,7 +192,7 @@ stdenv.mkDerivation ({
190 buildPhase = ''
192 buildPhase = ''
191 runHook preBuild
193 runHook preBuild
192 # https://gitlab.haskell.org/ghc/ghc/issues/9221
194 # https://gitlab.haskell.org/ghc/ghc/issues/9221
193− $SETUP_HS build -j$(($NIX_BUILD_CORES > 4 ? 4 : $NIX_BUILD_CORES)) ${lib.concatStringsSep " " component.setupBuildFlags}
195+ $SETUP_HS build -j$(($NIX_BUILD_CORES > 4 ? 4 : $NIX_BUILD_CORES)) ${lib.concatStringsSep " " (component.setupBuildFlags ++ setupGhcOptions)}
194 runHook postBuild
196 runHook postBuild
@@ -211,7 +213,7 @@ stdenv.mkDerivation ({
211 "--html" \
213 "--html" \
212 ${lib.optionalString doHoogle "--hoogle"} \
214 ${lib.optionalString doHoogle "--hoogle"} \
213 ${lib.optionalString hyperlinkSource "--hyperlink-source"} \
215 ${lib.optionalString hyperlinkSource "--hyperlink-source"} \
214− ${lib.concatStringsSep " " component.setupHaddockFlags}
216+ ${lib.concatStringsSep " " (component.setupHaddockFlags ++ setupGhcOptions)}
216 html="dist/doc/html/${componentId.cname}"
218 html="dist/doc/html/${componentId.cname}"