haskell-te: 5e099ccb949c8a20154cdaf9c61bb0e0cee10f51
1: # Provides a set of Haskell packages for use by nix-eval.
2: { hsDirs }:
3:
4: with import ./.. {};
5: with builtins;
6: with rec {
7: hsDrvs = self: listToAttrs (map (dir:
8: with { d = toString (nixedHsPkg dir); };
9: {
10: value = self.callPackage d {};
11: name = pkgName (haskellPackages.callPackage d {}).name;
12: })
13: hsDirs);
14: hsNames = attrNames (hsDrvs haskellPackages);
15: givenHs = if getEnv("HASKELL_PACKAGES") == ""
16: then haskellPackages
17: else import getEnv("HASKELL_PACKAGES");
18: hsPkgs = givenHs.override {
19: overrides = hsOverride (self: super: hsDrvs self);
20: };
21:
22: # Check that these Haskell packages build
23: check = runCommand "check-for-pkgs.nix"
24: {
25: buildInputs = [((hsPkgs.ghcWithPackages (h: map (n: getAttr n h)
26: hsNames)).override {
27: ignoreCollisions = true;
28: })];
29: }
30: ''echo "true" > "$out"'';
31: };
32:
33: assert hsDirs != [] || abort "Got no OUT_DIRS";
34: assert import check || abort "Couldn't build pkgs";
35: hsPkgs
Generated by git2html.