-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.nix
123 lines (109 loc) · 2.9 KB
/
build.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
{ pkgs, haskell-nix, compiler-nix-name, plutip, coopPlutusCli, plutipLocalCluster, coop-hs-types, txBuilderProtoHs, cardanoProtoHs, cardanoProtoExtras, http2-grpc-native, shellHook }:
let
# FIXME: Use idiomatic cardano-node from bpi input
cardanoNode = proj.hsPkgs.cardano-node.components.exes.cardano-node;
cardanoCli = proj.hsPkgs.cardano-cli.components.exes.cardano-cli;
proj = haskell-nix.cabalProject' {
src = ./.;
name = "coop-pab";
inherit compiler-nix-name;
index-state = "2022-05-16T00:00:00Z";
inherit (plutip) cabalProjectLocal;
modules = plutip.haskellModules ++ [
{
packages = {
# Enable strict builds
coop-pab.configureFlags = [ "-f-dev" ];
# Link coop-plutus-cli into tests
coop-pab.components.tests.coop-pab-tests.build-tools = [
coopPlutusCli
cardanoNode
cardanoCli
];
# Don't use the new-ledger-namespace
coop-hs-types.configureFlags = [ "-f-new-ledger-namespace" ];
# FIXME: This is annoying
# Add proto compilation execs
proto-lens-protobuf-types.components.library.build-tools = [
pkgs.protobuf
pkgs.haskellPackages.proto-lens-protoc
];
};
}
];
extraSources = plutip.extraSources ++ [
{
src = plutip;
subdirs = [ "." ];
}
{
src = coop-hs-types;
subdirs = [ "." ];
}
{
src = http2-grpc-native;
subdirs = [
"http2-client-grpc"
"http2-grpc-proto-lens"
"http2-grpc-types"
"warp-grpc"
];
}
{
src = txBuilderProtoHs;
subdirs = [ "." ];
}
{
src = cardanoProtoHs;
subdirs = [ "." ];
}
{
src = cardanoProtoExtras;
subdirs = [ "." ];
}
];
shell = {
withHoogle = true;
exactDeps = true;
nativeBuildInputs = with pkgs; [
# Code quality
## Haskell/Cabal
haskellPackages.apply-refact
haskellPackages.fourmolu
haskellPackages.cabal-fmt
hlint
coopPlutusCli
cardanoNode
cardanoCli
grpcui
grpcurl
plutipLocalCluster
];
additional = ps: [
ps.bot-plutus-interface
ps.plutip
ps.coop-hs-types
ps.cardano-proto-extras
ps.coop-cardano-proto
# Needed to run the coop.TxBuilder gRpc service
ps.http2-client-grpc
ps.http2-grpc-proto-lens
ps.http2-grpc-types
ps.warp-grpc
ps.coop-tx-builder-service-proto
];
tools = {
cabal = { };
haskell-language-server = { };
};
shellHook = ''
${shellHook}
export LC_CTYPE=C.UTF-8
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
source ${./aux.bash}
'';
};
};
in
proj