stackage2nix 0.5.0 → 0.6.0
raw patch · 4 files changed
+36/−19 lines, 4 files
Files
- CHANGELOG.md +5/−0
- src/Distribution/Nixpkgs/Haskell/Stack/PrettyPrinting.hs +28/−14
- src/Stack/Types.hs +2/−4
- stackage2nix.cabal +1/−1
CHANGELOG.md view
@@ -25,3 +25,8 @@ - Remove `--do-haddock-stackage` flag (enabled by default) - Remove `--no-packages-closure` flag (use `--with-stackage-closure`) - Remove `cabal2nix < 2.7.2` support #45++# 0.6.0++- Replace call to `<nixpkgs/pkgs/development/haskell-modules>` in generated+ Haskell packages with `makePackageSet` library function
src/Distribution/Nixpkgs/Haskell/Stack/PrettyPrinting.hs view
@@ -19,10 +19,10 @@ data OverrideConfig = OverrideConfig- { _ocGhc :: !Version- , _ocStackagePackages :: !FilePath- , _ocStackageConfig :: !FilePath- , _ocNixpkgs :: !FilePath+ { _ocGhc :: Version+ , _ocStackagePackages :: FilePath+ , _ocStackageConfig :: FilePath+ , _ocNixpkgs :: FilePath } makeLenses ''OverrideConfig@@ -110,23 +110,37 @@ [ funargs [ "callPackage" , "pkgs"+ , "stdenv"+ , "lib" , "overrides ? (self: super: {})"- , "packageSetConfig ? (sefl: super: {})"+ , "packageSetConfig ? (self: super: {})" ] , "" , "let" , nest 2 $ vcat- [ attr "haskellLib" "pkgs.haskell.lib"- ]- , "in callPackage (<nixpkgs/pkgs/development/haskell-modules>) {"- , nest 2 $ vcat- [ attr "ghc" ("pkgs.haskell.compiler." <> toNixGhcVersion (oc ^. ocGhc))+ [ "inherit (lib) extends makeExtensible;"+ , attr "haskellLib" "pkgs.haskell.lib"+ , "inherit (haskellLib) makePackageSet;"+ , ""+ , attr "haskellPackages" $ vcat+ [ "pkgs.callPackage makePackageSet {"+ , nest 2 $ vcat+ [ attr "ghc" ("pkgs.haskell.compiler." <> toNixGhcVersion (oc ^. ocGhc))+ , attr "package-set" . importStackagePackages $ oc ^. ocStackagePackages+ , "inherit stdenv haskellLib extensible-self;"+ ]+ , "}"+ ]+ , "" , attr "compilerConfig" . importStackageConfig $ oc ^. ocStackageConfig- , attr "initialPackages" . importStackagePackages $ oc ^. ocStackagePackages- , attr "configurationCommon" "if builtins.pathExists ./configuration-common.nix then import ./configuration-common.nix else args: self: super: {}"- , "inherit haskellLib overrides packageSetConfig;"+ , ""+ , attr "configurationCommon" "if builtins.pathExists ./configuration-common.nix then import ./configuration-common.nix { inherit pkgs haskellLib; } else self: super: {}"+ , attr "configurationNix" "import <nixpkgs/pkgs/development/haskell-modules/configuration-nix.nix> { inherit pkgs haskellLib; }"+ , ""+ , attr "extensible-self" "makeExtensible (extends overrides (extends configurationCommon (extends packageSetConfig (extends compilerConfig (extends configurationNix haskellPackages)))))" ]- , "}"+ , ""+ , "in extensible-self" ] toNixGhcVersion :: Version -> Doc
src/Stack/Types.hs view
@@ -1,5 +1,3 @@-{-# LANGUAGE TemplateHaskell #-}- module Stack.Types where import Control.Lens@@ -8,8 +6,8 @@ data StackYaml = StackYaml- { _syDirName :: !FilePath- , _syFileName :: !FilePath }+ { _syDirName :: FilePath+ , _syFileName :: FilePath } deriving (Ord, Eq, Show) makeLenses ''StackYaml
stackage2nix.cabal view
@@ -1,5 +1,5 @@ name: stackage2nix-version: 0.5.0+version: 0.6.0 synopsis: Convert Stack files into Nix build instructions. homepage: https://github.com/typeable/stackage2nix#readme license: BSD3