@@ -20,7 +20,9 @@ import Language.Nix.PrettyPrinting as PP
20data OverrideConfig = OverrideConfig
20data OverrideConfig = OverrideConfig
21 { _ocGhc :: !Version
21 { _ocGhc :: !Version
22 , _ocStackagePackages :: !FilePath
22 , _ocStackagePackages :: !FilePath
23− , _ocStackageConfig :: !FilePath }
23+ , _ocStackageConfig :: !FilePath
24+ , _ocNixpkgs :: !FilePath
25makeLenses ''OverrideConfig
27makeLenses ''OverrideConfig
@@ -43,20 +45,16 @@ importStackagePackages path = hsep
46−importStackageConfig :: FilePath -> Doc
47−importStackageConfig path = hsep
48− [ "import", disp (fromString path :: Nix.FilePath), "{"
53callStackageConfig :: FilePath -> Doc
48callStackageConfig :: FilePath -> Doc
54callStackageConfig path = hsep
49callStackageConfig path = hsep
55 [ "callPackage", disp (fromString path :: Nix.FilePath), "{}"]
50 [ "callPackage", disp (fromString path :: Nix.FilePath), "{}"]
57overrideHaskellPackages :: OverrideConfig -> NonEmpty Derivation -> Doc
52overrideHaskellPackages :: OverrideConfig -> NonEmpty Derivation -> Doc
58overrideHaskellPackages oc packages = vcat
53overrideHaskellPackages oc packages = vcat
59− [ funargs ["nixpkgs ? import <nixpkgs> {}"]
54+ [ funargs ["nixpkgs ? import "
55+ <> disp (fromString (oc ^. ocNixpkgs) :: Nix.FilePath)
61 , "with nixpkgs;"
59 , "with nixpkgs;"
@@ -74,10 +72,11 @@ overrideHaskellPackages oc packages = vcat
77− , "in callPackage <nixpkgs/pkgs/development/haskell-modules> {"
75+ , "in callPackage (nixpkgs.path + \"/pkgs/development/haskell-modules\") {"
78 , nest 2 $ vcat
76 , nest 2 $ vcat
79 [ attr "ghc" ("pkgs.haskell.compiler." <> toNixGhcVersion (oc ^. ocGhc))
77 [ attr "ghc" ("pkgs.haskell.compiler." <> toNixGhcVersion (oc ^. ocGhc))
80 , attr "compilerConfig" "self: extends pkgOverrides (extends stackageConfig (stackagePackages self))"
78 , attr "compilerConfig" "self: extends pkgOverrides (extends stackageConfig (stackagePackages self))"
79+ , attr "haskellLib" "callPackage (nixpkgs.path + \"/pkgs/development/haskell-modules/lib.nix\") {}"