diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix index 7929d99de15..2dcf206cec9 100644 --- a/pkgs/development/haskell-modules/with-packages-wrapper.nix +++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix @@ -32,8 +32,10 @@ let isGhcjs = ghc.isGhcjs or false; ghc761OrLater = isGhcjs || lib.versionOlder "7.6.1" ghc.version; packageDBFlag = if ghc761OrLater then "--global-package-db" else "--global-conf"; - ghcCommand = if isGhcjs then "ghcjs" else "ghc"; - ghcCommandCaps= lib.toUpper ghcCommand; + ghcCommand' = if isGhcjs then "ghcjs" else "ghc"; + crossPrefix = if (ghc.cross or null) != null then "${ghc.cross.config}-" else ""; + ghcCommand = "${crossPrefix}${ghcCommand'}"; + ghcCommandCaps= lib.toUpper ghcCommand'; libDir = "$out/lib/${ghcCommand}-${ghc.version}"; docDir = "$out/share/doc/ghc/html"; packageCfgDir = "${libDir}/package.conf.d";