-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
67 lines (59 loc) · 2.15 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
{
description = "Flake for development workflows.";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
rainix.url = "github:rainlanguage/rainix";
rain.url = "github:rainlanguage/rain.cli";
};
outputs = { self, flake-utils, rainix, rain }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = rainix.pkgs.${system};
in rec {
packages = rec {
i9r-prelude = rainix.mkTask.${system} {
name = "i9r-prelude";
body = ''
set -euxo pipefail
# Needed by deploy script.
mkdir -p deployments/latest;
# Build metadata that is needed for deployments.
mkdir -p meta;
forge script --silent ./script/BuildAuthoringMeta.sol;
rain meta build \
-i <(cat ./meta/AuthoringMeta.rain.meta) \
-m authoring-meta-v2 \
-t cbor \
-e deflate \
-l none \
-o meta/RainterpreterExpressionDeployerNPE2.rain.meta \
;
rain meta build \
-i <(cat ./meta/RainterpreterReferenceExternNPE2AuthoringMeta.rain.meta) \
-m authoring-meta-v2 \
-t cbor \
-e deflate \
-l none \
-o meta/RainterpreterReferenceExternNPE2.rain.meta \
'';
additionalBuildInputs = rainix.sol-build-inputs.${system} ++ [rain.defaultPackage.${system}];
};
test-wasm-build = rainix.mkTask.${system} {
name = "test-wasm-build";
body = ''
set -euxo pipefail
cargo build --target wasm32-unknown-unknown --exclude rain-i9r-cli --exclude rain-interpreter-env --workspace
'';
};
} // rainix.packages.${system};
devShells.default = pkgs.mkShell {
shellHook = rainix.devShells.${system}.default.shellHook;
packages = [
packages.i9r-prelude
packages.test-wasm-build
];
inputsFrom = [ rainix.devShells.${system}.default ];
};
}
);
}