-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.nix
94 lines (85 loc) · 1.97 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
{ pkgs, haskell-nix, compiler-nix-name, http2-grpc-native, cardanoProtoHs, publisherProtoHs, txBuilderProtoHs, factStatementStoreProtoHs, shellHook }:
haskell-nix.cabalProject' {
src = ./.;
name = "coop-publisher";
inherit compiler-nix-name;
index-state = "2022-01-21T23:44:46Z";
extraSources = [
{
src = http2-grpc-native;
subdirs = [
"http2-client-grpc"
"http2-grpc-proto-lens"
"http2-grpc-types"
"warp-grpc"
];
}
{
src = cardanoProtoHs;
subdirs = [ "." ];
}
{
src = publisherProtoHs;
subdirs = [ "." ];
}
{
src = txBuilderProtoHs;
subdirs = [ "." ];
}
{
src = factStatementStoreProtoHs;
subdirs = [ "." ];
}
];
modules = [
(_: {
packages = {
allComponent.doHoogle = true;
allComponent.doHaddock = true;
# FIXME: This is annoying
# Add proto compilation execs
proto-lens-protobuf-types.components.library.build-tools = [
pkgs.protobuf
pkgs.haskellPackages.proto-lens-protoc
];
};
})
];
shell = {
withHoogle = true;
exactDeps = true;
# We use the ones from vanilla Nixpkgs, since they are cached reliably.
nativeBuildInputs = with pkgs; [
# Code quality
## Haskell/Cabal
haskellPackages.fourmolu
haskellPackages.cabal-fmt
hlint
## Nix
nixpkgs-fmt
grpcui
grpcurl
];
additional = ps: [
ps.http2-client-grpc
ps.http2-grpc-proto-lens
ps.http2-grpc-types
ps.warp-grpc
ps.coop-cardano-proto
ps.coop-publisher-service-proto
ps.coop-tx-builder-service-proto
ps.coop-fact-statement-store-service-proto
];
tools = {
cabal = { };
hlint = { };
haskell-language-server = { };
};
shellHook = ''
export LC_CTYPE=C.UTF-8
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
${shellHook}
'';
};
}