-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathflake.nix
More file actions
79 lines (71 loc) · 2.33 KB
/
Copy pathflake.nix
File metadata and controls
79 lines (71 loc) · 2.33 KB
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
{
description = "Flake for development workflows.";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
rainix.url = "github:rainlanguage/rainix";
rain.url = "github:rainlanguage/rain.cli";
# rain.cli pulls its own rainix; make it follow ours so the lock has a
# single rainix (and one rust toolchain / nixpkgs) instead of two revs.
rain.inputs.rainix.follows = "rainix";
};
outputs =
{
flake-utils,
rainix,
rain,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = rainix.pkgs.${system};
in
rec {
packages = rec {
rainlang-prelude = rainix.mkTask.${system} {
name = "rainlang-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/RainlangExpressionDeployer.rain.meta \
;
rain meta build \
-i <(cat ./meta/RainlangReferenceExternAuthoringMeta.rain.meta) \
-m authoring-meta-v2 \
-t cbor \
-e deflate \
-l none \
-o meta/RainlangReferenceExtern.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 rainlang-cli --workspace
'';
};
}
// rainix.packages.${system};
devShells.default = pkgs.mkShell {
inherit (rainix.devShells.${system}.default) shellHook;
packages = [
packages.rainlang-prelude
packages.test-wasm-build
];
inputsFrom = [ rainix.devShells.${system}.default ];
};
}
);
}