-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
78 lines (68 loc) · 2.09 KB
/
flake.nix
File metadata and controls
78 lines (68 loc) · 2.09 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
{
description = "CCTP CLI development shell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
crane.url = "github:ipetkov/crane";
};
outputs = { self, nixpkgs, flake-utils, crane }:
flake-utils.lib.eachSystem [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
] (system:
let
pkgs = import nixpkgs { inherit system; };
craneLib = crane.mkLib pkgs;
svmReleasesList = pkgs.fetchurl {
url = {
x86_64-linux = "https://binaries.soliditylang.org/linux-amd64/list.json";
aarch64-linux = "https://binaries.soliditylang.org/linux-arm64/list.json";
x86_64-darwin = "https://binaries.soliditylang.org/macosx-amd64/list.json";
}.${system};
sha256 = {
x86_64-linux = "1labmjyg3vpyjr2q6idhy3wzsj92wxj3qvf32h0g2b8nsnhf0z1g";
aarch64-linux = "15j5p9iz51npy2jjfaqkwwd4gbkapnry8jzq41yv1y7qwg1z0d8v";
x86_64-darwin = "0ika5973adqvbw5nk5h46wjymwzr3sq92vahzcmvrw6adif1v8wz";
}.${system};
};
commonArgs = {
pname = "cctp";
version = "0.1.0";
src = ./.;
strictDeps = true;
SVM_RELEASES_LIST_JSON = svmReleasesList;
nativeBuildInputs = with pkgs; [
pkg-config
];
buildInputs = with pkgs; [
openssl
];
};
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
cctp = craneLib.buildPackage (commonArgs // {
inherit cargoArtifacts;
});
in
{
packages = {
inherit cctp;
default = cctp;
};
devShells.default = pkgs.mkShell {
packages = with pkgs; [
rustc
cargo
rustfmt
clippy
openssl
pkg-config
rust-analyzer
];
shellHook = ''
echo "CCTP dev shell"
echo "Available: cargo, rustc, rustfmt, clippy, rust-analyzer"
'';
};
});
}