This repository has been archived by the owner on Apr 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
110 lines (99 loc) · 2.62 KB
/
default.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
let
sources = import ./nix/sources.nix;
in
{ pkgs ? import sources.unstable { }
}:
let
inherit (pkgs.haskell.lib)
justStaticExecutables
overrideCabal
;
inherit (pkgs)
fetchFromGitHub
lib
remove-references-to
;
undotted = x: lib.replaceChars [ "." ] [ "" ] x;
# We need to explicitly disable GHC core libraries here. stack2nix does null some of them out but
# has not been updated for newer GHC versions so few of them are missing. The lists of the core
# libraries are taken directly from configuration-ghc-8.x.x.nix files from nixpkgs.
hie-pkg-sets =
lib.mapAttrs
(
_: pkg-set:
pkg-set.override (
old: {
# common overrides applicable to all sets
overrides = lib.composeExtensions
(old.overrides or (_:_: { }))
(import ./overrides/common.nix {
inherit pkgs lib undotted;
}
);
}
)
)
{
ghc-865 =
(
import ./hie/ghc-8.6.5.nix {
inherit pkgs;
}
).override (
old: {
overrides = lib.composeExtensions (old.overrides or (_:_: { })) (
_: _: (import ./overrides/base-8.6.x.nix)
);
}
);
ghc-882 =
(
import ./hie/ghc-8.8.2.nix {
inherit pkgs;
}
).override (
old: {
overrides = lib.composeExtensions (old.overrides or (_:_: { })) (
_: _: (import ./overrides/base-8.8.x.nix)
);
}
);
ghc-883 =
(
import ./hie/ghc-8.8.3.nix {
inherit pkgs;
}
).override (
old: {
overrides = lib.composeExtensions (old.overrides or (_:_: { })) (
_: _: (import ./overrides/base-8.8.x.nix)
);
}
);
ghc-884 =
(
import ./hie/ghc-8.8.4.nix {
inherit pkgs;
}
).override (
old: {
overrides = lib.composeExtensions (old.overrides or (_:_: { })) (
_: _: (import ./overrides/base-8.8.x.nix)
);
}
);
};
hies = lib.mapAttrs (_: hie-pkg-set: hie-pkg-set.haskell-ide-engine) hie-pkg-sets;
compose = import ./compose.nix {
inherit pkgs lib hies undotted;
};
in
{
hie = lib.recurseIntoAttrs hies // {
inherit compose;
lib = {
inherit compose;
};
};
composed = compose lib.id;
}