forked from kadena-io/kadenamint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
62 lines (52 loc) · 1.71 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
60
61
62
{ system ? builtins.currentSystem
, withHoogle ? false
}:
let
rp = (import ./dep/pact {}).rp;
in rp.project ({ pkgs, hackGet, ... }:
let
hs-abci = hackGet ./dep/hs-abci;
pact = hackGet ./dep/pact;
which = hackGet ./dep/which;
tendermint = pkgs.callPackage ./dep/tendermint.nix {};
purifyEnvironment =
let isImpure = p: pkgs.lib.strings.hasPrefix ".ghc.environment" p
|| builtins.elem p [".git" "result" "dist-newstyle"];
in builtins.filterSource (path: type: !isImpure (baseNameOf path));
in {
inherit withHoogle;
passthru = {
inherit tendermint;
inherit (pkgs) tmux;
nixpkgs = pkgs;
overrideDerivation = pkgs.lib.overrideDerivation;
};
packages = {
inherit pact which;
kadenamint = purifyEnvironment ./.;
};
shells = {
ghc = ["kadenamint"];
};
overrides = with pkgs.haskell.lib; pkgs.lib.foldr pkgs.lib.composeExtensions (_: _: {}) [
(import hs-abci {}).overrides
(import (pact + /overrides.nix) pkgs)
(self: super: {
kadenamint = overrideCabal super.kadenamint (drv: {
buildTools = (drv.buildTools or []) ++ [ pkgs.buildPackages.makeWrapper ];
executableSystemDepends = (drv.executableSystemDepends or []) ++ [ tendermint pkgs.z3];
postFixup = ''
${drv.postFixup or ""}
wrapProgram "$out"/bin/kadenamint --set SBV_Z3 ${pkgs.z3}/bin/z3
'';
});
pact = dontCoverage super.pact;
tomland = dontCheck (self.callHackageDirect {
pkg = "tomland";
ver = "1.0.1.0";
sha256 = "0m9x09f694rlkmvmrba79dcffzdy8abs6fs56j8a6525lx46vccl";
} {});
})
];
}
)