Last active
December 20, 2019 15:18
-
-
Save ocharles/76e595f0013a66efbc355afb8795070b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
haskellPackages = | |
pkgs.haskellPackages.override { | |
overrides = self: super: | |
let | |
mk-packagedb = | |
packages: | |
pkgs.runCommand "make-package-db" {} | |
'' | |
mkdir $out | |
${ pkgs.lib.concatMapStringsSep | |
"\n" | |
( pkg: "cp -f ${pkg}/lib/ghc-8.6.5/package.conf.d/*.conf $out/" ) | |
packages } | |
${self.ghc}/bin/ghc-pkg --package-db="$out" recache | |
''; | |
in | |
{ | |
ghc-nix = | |
self.callPackage ../ghc-nix {}; | |
fused-effects = | |
( pkgs.haskell.lib.overrideCabal | |
super.fused-effects | |
( args: | |
{ configureFlags = [ "-w ${self.ghc-nix}/bin/ghc-nix" ]; | |
buildTools = [ pkgs.which nix ]; | |
postConfigure = "ls -l /build/package.conf.d ; echo $PACKAGE_DB"; | |
} | |
) ).overrideAttrs ( oldAttrs: { | |
requiredSystemFeatures = [ "recursive-nix" ]; | |
NIX_PATH = pkgs.path; | |
PACKAGE_DB = mk-packagedb ( builtins.filter ( x: x != null ) ( super.fused-effects.buildInputs ++ super.fused-effects.propagatedBuildInputs ) ); | |
}); | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment