forked from input-output-hk/marlowe-cardano
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
179 lines (157 loc) · 4.84 KB
/
flake.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
{
description = "Marlowe Cardano implementation";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.follows = "haskell-nix/nixpkgs-2205";
haskell-nix = {
url = "github:input-output-hk/haskell.nix";
inputs.hackage.follows = "hackage";
};
hackage = {
url = "github:input-output-hk/hackage.nix";
flake = false;
};
actus-tests = {
url = "github:actusfrf/actus-tests";
flake = false;
};
haskell-language-server = {
# Pinned to a release
url = "github:haskell/haskell-language-server?ref=1.3.0";
flake = false;
};
npmlock2nix = {
url = "github:tweag/npmlock2nix";
flake = false;
};
iohk-nix = {
url = "github:input-output-hk/iohk-nix/marlowe-dev-testnet";
flake = false;
};
cardano-world = {
url = "github:input-output-hk/cardano-world";
};
CHaP = {
url = "github:input-output-hk/cardano-haskell-packages?ref=repo";
flake = false;
};
plutus-core = {
url = "github:input-output-hk/plutus";
flake = false;
};
pre-commit-hooks-nix = {
url = "github:cachix/pre-commit-hooks.nix";
flake = false;
};
sphinxcontrib-haddock = {
url = "github:michaelpj/sphinxcontrib-haddock";
flake = false;
};
tullia = {
url = "github:input-output-hk/tullia";
};
};
outputs = { self, flake-utils, tullia, ... }@inputs:
let
systems = [ "x86_64-linux" "x86_64-darwin" ];
in
(flake-utils.lib.eachSystem systems (system:
let
packages = self.internal.packagesFun { inherit system; };
packagesLinux = self.internal.packagesFun { system = "x86_64-linux"; };
packagesProf = self.internal.packagesFun { inherit system; enableHaskellProfiling = true; };
in
{
inherit packages;
apps = rec {
updateMaterialized = {
type = "app";
program =
"${packages.dev-scripts.updateMaterialized}/bin/updateMaterialized";
};
nixpkgs-fmt = {
type = "app";
program =
"${packages.pkgs.nixpkgs-fmt}/bin/nixpkgs-fmt";
};
refresh-compose = {
type = "app";
program = (packages.pkgs.writeShellScript "refresh-compose" ''
cd $(git rev-parse --show-toplevel)
nix-store --realise ${packagesLinux.compose-spec} --add-root compose.yaml --indirect
'').outPath;
};
re-up = {
type = "app";
program = (packages.pkgs.writeShellScript "re-up" ''
cd $(git rev-parse --show-toplevel)
${refresh-compose.program}
docker compose up --detach
'').outPath;
};
chainseekd = {
type = "app";
program = "${packages.chainseekd}/bin/chainseekd";
};
marlowe-chain-indexer = {
type = "app";
program = "${packages.marlowe-chain-indexer}/bin/marlowe-chain-indexer";
};
marlowe-history = {
type = "app";
program = "${packages.marlowe-history}/bin/marlowe-history";
};
marlowe-discovery = {
type = "app";
program = "${packages.marlowe-discovery}/bin/marlowe-discovery";
};
marlowe-tx = {
type = "app";
program = "${packages.marlowe-tx}/bin/marlowe-tx";
};
marlowe = {
type = "app";
program = "${packages.marlowe-rt}/bin/marlowe";
};
};
devShells.default = import ./dev-shell.nix {
inherit system packages;
};
devShells.prof = import ./dev-shell.nix {
inherit system;
packages = packagesProf;
};
# Export ciJobs for tullia to parse
ciJobs = self.hydraJobs {
supportedSystems = [ system ];
};
}
// tullia.fromSimple system (import ./nix/tullia.nix)
)) // {
hydraJobs = import ./hydra-jobs.nix {
inherit inputs;
inherit (self) internal;
marlowe-cardano = self;
};
internal.packagesFun =
{ system
, checkMaterialization ? false
, enableHaskellProfiling ? false
, source-repo-override ? { }
, crossSystem ? null
, evalSystem ? system
}: import ./packages.nix {
inherit system inputs;
packagesBySystem = builtins.listToAttrs (map
(system': {
name = system';
value = import ./nix {
system = system';
inherit checkMaterialization enableHaskellProfiling source-repo-override inputs crossSystem evalSystem;
inherit (inputs) haskell-nix;
};
})
systems);
};
};
}