-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
64 lines (63 loc) · 1.89 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
zombienet = {
url = "github:paritytech/zombienet";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay, zombienet }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) zombienet.overlays.default ];
pkgs = import nixpkgs {
inherit system overlays;
};
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
buildInputs = with pkgs; [
cargo-expand
cargo-tarpaulin
clang
just
mdbook
mdbook-linkcheck
openssl
pkg-config
polkadot
rustToolchain
subxt
taplo
jq
# Due to zombienet's flake.nix, needs to be prefixed with pkg.zombienet
pkgs.zombienet.default
# rust-fil-proofs OpenCL dependencies (https://github.com/filecoin-project/rust-fil-proofs/blob/5a0523ae1ddb73b415ce2fa819367c7989aaf73f/README.md?plain=1#L74)
ocl-icd
hwloc
]
++ (lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.CoreServices
darwin.apple_sdk.frameworks.SystemConfiguration
darwin.apple_sdk.frameworks.OpenCL
]);
in
with pkgs;
{
devShells.default = mkShell {
inherit buildInputs;
OPENSSL_NO_VENDOR = 1;
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
PROTOC = "${protobuf}/bin/protoc";
RUST_SRC_PATH = "${rustToolchain}/lib/rustlib/src/rust/library/";
};
}
);
}