-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
41 lines (32 loc) · 1.02 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
let config = import ./config.nix; in
{ ghcVersion ? config.ghc.default }:
let
pkgsMakePath =
(import <nixpkgs> {}).fetchFromGitHub {
owner = "shajra";
repo = "example-nix";
rev = config.example-nix.rev;
sha256 = config.example-nix.sha256;
};
pkgsMake = import pkgsMakePath;
pkgsMakeArgs = {
haskellArgs = {
inherit ghcVersion;
srcTransform = lib:
lib.nix.filterFilesBySuffices [ ".hs" ".cabal" "LICENSE" ".md" ];
extraOverrides = nixpkgs: self: super:
if ghcVersion == "ghc802"
then { cabal2nix = nixpkgs.haskell.packages.ghc844.cabal2nix; }
else {};
};
nixpkgsRev = config.nixpkgs.rev;
nixpkgsSha256 = config.nixpkgs.sha256;
};
in
pkgsMake pkgsMakeArgs ({call, lib, ...}: rec {
exceptions-checked =
lib.haskell.enableCabalFlag
(call.haskell.cabal2nix.lib ./.)
"strict";
exceptions-checked-doc = exceptions-checked.doc;
})