forked from sebastiaanvisser/clay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.nix
67 lines (57 loc) · 1.87 KB
/
release.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ compiler ? "ghc884" }:
let
# Disable tests for these packages
dontCheckPackages = [
];
# Jailbreak these packages
doJailbreakPackages = [
];
# Disable haddocks for these packages
dontHaddockPackages = [
];
generatedOverrides = haskellPackagesNew: haskellPackagesOld:
let
toPackage = file: _: {
name = builtins.replaceStrings [ ".nix" ] [ "" ] file;
value = haskellPackagesNew.callPackage (./. + "/nix/${file}") { };
};
in
pkgs.lib.mapAttrs' toPackage (builtins.readDir ./nix);
makeOverrides =
function: names: haskellPackagesNew: haskellPackagesOld:
let
toPackage = name: {
inherit name;
value = function haskellPackagesOld.${name};
};
in
builtins.listToAttrs (map toPackage names);
composeExtensionsList =
pkgs.lib.fold pkgs.lib.composeExtensions (_: _: {});
# More exotic overrides go here
manualOverrides = haskellPackagesNew: haskellPackagesOld: {
};
config = {
packageOverrides = pkgs: rec {
haskell = pkgs.haskell // {
packages = pkgs.haskell.packages // {
"${compiler}" = pkgs.haskell.packages."${compiler}".override {
overrides = composeExtensionsList [
generatedOverrides
(makeOverrides pkgs.haskell.lib.dontCheck dontCheckPackages )
(makeOverrides pkgs.haskell.lib.doJailbreak doJailbreakPackages)
(makeOverrides pkgs.haskell.lib.dontHaddock dontHaddockPackages)
manualOverrides
];
};
};
};
};
};
pkgs = import (builtins.fetchTarball (import ./nix/nixpkgs.nix)) { inherit config; };
in
{ clay = pkgs.haskell.packages.${compiler}.clay;
examples = pkgs.haskell.packages.${compiler}.callCabal2nix "examples" ./examples {};
cabal = pkgs.haskellPackages.cabal-install;
pkgs = pkgs;
}