-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
37 lines (35 loc) · 1.11 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
{ compiler ? "ghc881", pkgs ? import ./nix/packages.nix {} }:
with pkgs;
let
inherit (haskell.lib) doJailbreak dontCheck;
haskellPackages = haskell.packages.${compiler};
hpack = haskellPackages.callPackage ./nix/hpack.nix {};
haskellPkgs = haskellPackages.override {
overrides = self: super: {
hpack = self.callCabal2nix "hpack" hpack {};
prettyprinter = self.prettyprinter_1_3_0;
protolude = doJailbreak super.protolude;
neat-interpolation = dontCheck super.neat-interpolation;
};
};
# We have to call hpack now ourselves since current hpack is broken
hpack2cabal = name: src: pkgs.runCommand "hpack2cabal-${name}" {} ''
${hpack}/bin/hpack '${src}' - > "$out"
'';
source = nix-gitignore.gitignoreSource [] ./.;
processedSource = hpack2cabal "typesystem" source;
drv = haskellPkgs.callCabal2nix "typesystem" processedSource {};
in
{
typesystem = drv;
typesystem-shell = haskellPkgs.shellFor {
packages = p: [ drv ];
buildInputs = with haskellPkgs; [
cabal-install
hpack
hlint
ghcid
];
withHoogle = true;
};
}