@@ -3,9 +3,11 @@ module Runner ( run ) where
33import Control.Lens
44import Distribution.Nixpkgs.Haskell.Stack
55import Distribution.Nixpkgs.Haskell.Stack.PrettyPrinting as PP
6+import Distribution.Version (Version(..))
67import Options.Applicative
78import Runner.Cli
89import Stack.Config
10+import Stackage.Types
911
1012import qualified Stackage2nix as S2n
1113
@@ -24,12 +26,12 @@ run = do
2426 , S2n.optNixpkgsMap = Nothing
2527 , S2n.optOutPackages = opts ^. optStackageOutPackages
2628 , S2n.optOutConfig = opts ^. optStackageOutConfig }
27− _ <- S2n.run s2nOptions
29+ buildPlan <- S2n.run s2nOptions
2830
2931 -- generate haskell packages override
3032 let
3133 pkgConfig = mkPackageConfig (opts ^. optPlatform) (opts ^. optCompilerId)
32− overrideConfig = mkOverrideConfig opts
34+ overrideConfig = mkOverrideConfig opts (siGhcVersion $ bpSystemInfo buildPlan)
3335 packages <- traverse (packageDerivation pkgConfig (opts ^. optHackageDb))
3436 $ stackYaml ^. scPackages
3537 let
@@ -38,8 +40,8 @@ run = do
3840 writeFile (opts ^. optOutFile) (show out)
3941 putStrLn $ "\nDerivation was written to " ++ opts ^. optOutFile
4042
41−mkOverrideConfig :: Options -> OverrideConfig
42−mkOverrideConfig opts = OverrideConfig
43− { _ocGhc = "ghc802"
43+mkOverrideConfig :: Options -> Version -> OverrideConfig
44+mkOverrideConfig opts ghcVersion = OverrideConfig
45+ { _ocGhc = ghcVersion
4446 , _ocStackagePackages = opts ^. optStackageOutPackages
4547 , _ocStackageConfig = opts ^. optStackageOutConfig }