-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdefault.nix
59 lines (53 loc) · 1.3 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
{ system ? builtins.currentSystem or "x86_64-linux"
, ghc ? "ghc947"
}:
let
nix = import ./nix;
pkgs = nix.pkgSetForSystem system {
config = {
allowBroken = true;
allowUnfree = true;
};
};
inherit (pkgs) lib;
hsPkgSetOverlay = pkgs.callPackage ./nix/haskell/overlay.nix {
inherit (nix) sources;
};
sources = [
"^src.*$"
"^test.*$"
"^.*\\.cabal$"
];
base = hsPkgs.callCabal2nix "th-utilities" (lib.sourceByRegex ./. sources) { };
th-utilities-overlay = _hf: _hp: { th-utilities = base; };
baseHaskellPkgs = pkgs.haskell.packages.${ghc};
hsOverlays = [ hsPkgSetOverlay th-utilities-overlay ];
hsPkgs = baseHaskellPkgs.override (old: {
overrides =
builtins.foldl' pkgs.lib.composeExtensions (old.overrides or (_: _: { }))
hsOverlays;
});
hls = pkgs.haskell.lib.overrideCabal hsPkgs.haskell-language-server
(_: { enableSharedExecutables = true; });
shell = hsPkgs.shellFor {
packages = p: [ p.th-utilities ];
nativeBuildInputs = (with pkgs; [
cabal-install
ghcid
hlint
hpack
niv
]) ++ [ hls ];
shellHook = ''
export PS1='$ '
hpack
'';
};
th-utilities = hsPkgs.th-utilities;
in {
inherit hsPkgs;
inherit ghc;
inherit pkgs;
inherit shell;
inherit th-utilities;
}