Pull in hnix-store and its overlays

This commit is contained in:
John Ericson 2019-03-09 19:55:31 -05:00 committed by John Wiegley
parent eae6bf542f
commit 5f1605bcbf
1 changed files with 30 additions and 12 deletions

View File

@ -24,23 +24,41 @@
, mkDerivation ? null
}:
let haskellPackages = pkgs.haskell.packages.${compiler};
let
hnix-store-src = pkgs.fetchFromGitHub {
owner = "haskell-nix";
repo = "hnix-store";
rev = "440dfebc288eee184925292a740758e238b6d2ef";
sha256 = "12pzj10l4kcrp8kj83ww7w2g6zk897r8hmki94v6653pbx4b7w1f";
};
overlay = pkgs.lib.foldr pkgs.lib.composeExtensions (_: _: {}) [
(import "${hnix-store-src}/overlay.nix")
(self: super: with pkgs.haskell.lib; {
mono-traversable = dontCheck super.mono-traversable;
these = doJailbreak super.these;
} // pkgs.lib.optionalAttrs withHoogle {
ghc = super.ghc // { withPackages = super.ghc.withHoogle; };
ghcWithPackages = self.ghc.withPackages;
})
];
overrideHaskellPackages = orig: {
buildHaskellPackages =
orig.buildHaskellPackages.override overrideHaskellPackages;
overrides = if orig ? overrides
then pkgs.lib.composeExtensions orig.overrides overlay
else overlay;
};
haskellPackages = pkgs.haskell.packages.${compiler}.override
overrideHaskellPackages;
drv = haskellPackages.developPackage {
name = "hnix";
root = ./.;
overrides = with pkgs.haskell.lib; self: super: {
mono-traversable = dontCheck super.mono-traversable;
these = doJailbreak super.these;
} //
(if withHoogle then {
ghc = super.ghc // { withPackages = super.ghc.withHoogle; };
ghcWithPackages = self.ghc.withPackages;
} else {});
source-overrides = {};
modifier = drv: pkgs.haskell.lib.overrideCabal drv (attrs: {
buildTools = (attrs.buildTools or []) ++ [
haskellPackages.cabal-install