-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdefault.nix
47 lines (40 loc) · 1.54 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
let sources = import ./nix/sources.nix;
in { ghc ? "ghc927", pkgs ? import sources.nixpkgs {
config = {
allowBroken = true;
allowUnfree = true;
};
} }:
with pkgs;
let
inherit (pkgs) callPackage;
inherit (pkgs.lib) composeExtensions sourceByRegex;
inherit (pkgs.haskell.lib) dontCheck justStaticExecutables;
############################################################################
# Haskell package set overlay containing overrides for newer packages than
# are included in the base nixpkgs set as well as additions from vendored
# or external source repositories.
haskellPkgSetOverlay =
pkgs.callPackage ./nix/haskell/overlay.nix { inherit sources; };
# Haskell package set overlay providing 'instrument' packages.
instrumentOverlay = pkgs.callPackage ./instrument/default.nix { };
instrumentCloudwatchOverlay =
pkgs.callPackage ./instrument-cloudwatch/default.nix { };
############################################################################
# Construct a 'base' Haskell package set
baseHaskellPkgs = pkgs.haskell.packages.${ghc};
# Makes overlays given a base haskell package set. Can be used by
# other projects
haskellOverlays =
[ haskellPkgSetOverlay instrumentOverlay instrumentCloudwatchOverlay ];
# Construct the final Haskell package set
haskellPkgs = baseHaskellPkgs.override (old: {
overrides = builtins.foldl' composeExtensions (old.overrides or (_: _: { }))
haskellOverlays;
});
in {
inherit haskellPkgs;
inherit pkgs;
inherit sources;
inherit haskellOverlays;
}