git.iko.soy/typeable/stackage2nix
on master help sign in
Call makePackageSet when generate Stackage
commitfdf9c0ce9db06cd4d9405909c8002f3aa7810c39 authorDmitry Bushev <bushevdv@gmail.com> dateFri 2 Feb 2018, 22:41 (9 years ago) parentf693cd9
1 file changed+24−10
src/Distribution/Nixpkgs/Haskell/Stack/PrettyPrinting.hs+24−10
src/Distribution/Nixpkgs/Haskell/Stack/PrettyPrinting.hs+24−10
@@ -110,23 +110,37 @@ pPrintHaskellPackages oc = vcat
110110 [ funargs
111111 [ "callPackage"
112112 , "pkgs"
113+ , "stdenv"
114+ , "lib"
113115 , "overrides ? (self: super: {})"
114− , "packageSetConfig ? (sefl: super: {})"
116+ , "packageSetConfig ? (self: super: {})"
115117 ]
116118 , ""
117119 , "let"
118120 , nest 2 $ vcat
119− [ attr "haskellLib" "pkgs.haskell.lib"
120− ]
121− , "in callPackage (<nixpkgs/pkgs/development/haskell-modules>) {"
122− , nest 2 $ vcat
123− [ attr "ghc" ("pkgs.haskell.compiler." <> toNixGhcVersion (oc ^. ocGhc))
121+ [ "inherit (lib) extends makeExtensible;"
122+ , attr "haskellLib" "pkgs.haskell.lib"
123+ , "inherit (haskellLib) makePackageSet;"
124+ , ""
125+ , attr "haskellPackages" $ vcat
126+ [ "pkgs.callPackage makePackageSet {"
127+ , nest 2 $ vcat
128+ [ attr "ghc" ("pkgs.haskell.compiler." <> toNixGhcVersion (oc ^. ocGhc))
129+ , attr "package-set" . importStackagePackages $ oc ^. ocStackagePackages
130+ , "inherit stdenv haskellLib extensible-self;"
131+ ]
132+ , "}"
133+ ]
134+ , ""
124135 , attr "compilerConfig" . importStackageConfig $ oc ^. ocStackageConfig
125− , attr "initialPackages" . importStackagePackages $ oc ^. ocStackagePackages
126− , attr "configurationCommon" "if builtins.pathExists ./configuration-common.nix then import ./configuration-common.nix else args: self: super: {}"
127− , "inherit haskellLib overrides packageSetConfig;"
136+ , ""
137+ , attr "configurationCommon" "if builtins.pathExists ./configuration-common.nix then import ./configuration-common.nix { inherit pkgs haskellLib; } else self: super: {}"
138+ , attr "configurationNix" "import <nixpkgs/pkgs/development/haskell-modules/configuration-nix.nix> { inherit pkgs haskellLib; }"
139+ , ""
140+ , attr "extensible-self" "makeExtensible (extends overrides (extends configurationCommon (extends packageSetConfig (extends compilerConfig (extends configurationNix haskellPackages)))))"
128141 ]
129− , "}"
142+ , ""
143+ , "in extensible-self"
130144 ]
131145
132146toNixGhcVersion :: Version -> Doc