-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoverlay.nix
More file actions
57 lines (47 loc) · 1.71 KB
/
overlay.nix
File metadata and controls
57 lines (47 loc) · 1.71 KB
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
{ compiler, withHoogle, withProfiling }:
self: super:
let
hsPkgs = if compiler == "default"
then super.haskellPackages
else super.haskell.packages.${compiler};
addHoogleOverlay = overlay:
self.lib.composeExtensions
overlay
(hself: hsuper: {
ghc = hsuper.ghc // { withPackages = hsuper.ghc.withHoogle; };
ghcWithPackages = hself.ghc.withPackages;
});
addProfilingOverlay = overlay:
self.lib.composeExtensions
overlay
(hself: hsuper: {
mkDerivation = args: hsuper.mkDerivation (args // {
enableLibraryProfiling = true;
});
});
maybeAddHoogle = if withHoogle
then addHoogleOverlay
else self.lib.id;
maybeAddProfiling = if withProfiling
then addProfilingOverlay
else self.lib.id;
hsPkgSources = {
polysemy = self.pkgs.fetchFromGitHub {
owner = "isovector";
repo = "polysemy";
sha256 = "0nyp4mmlz3hkppvaqzb9cr870cmhwzvcv7f2mjihyamzs3mjw5dn";
rev = "fadd603d592cba8ae25c5be7d1e2b656ee75935b";
};
};
hsPkgsOverlay = hself: hsuper: {
polysemy = hself.callCabal2nix "polysemy" "${hsPkgSources.polysemy}" {};
};
in
{
haskellPackages = hsPkgs.override (oldArgs: {
overrides =
self.lib.composeExtensions
(oldArgs.overrides or (_: _: {}))
(maybeAddProfiling (maybeAddHoogle hsPkgsOverlay));
});
}