-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
executable file
·82 lines (68 loc) · 2.05 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
{
description = "";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachSystem
[ flake-utils.lib.system.x86_64-linux flake-utils.lib.system.aarch64-linux flake-utils.lib.system.x86_64-windows ] (system:
let
overlays = [ (import rust-overlay) ];
pkgs =
import nixpkgs {
inherit system overlays;
};
rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
in rec
{
defaultPackage = packages.ethers;
packages.ethers = pkgs.rustPlatform.buildRustPackage {
pname = "ethers";
version = "0.0.0";
src = ./.;
# Build type
buildType = "release";
# Build type when running nix check
checkType = "release";
# Features
buildNoDefaultFeatures = false;
buildFeatures = [];
checkFeatures = [];
#PROTOC = "${pkgs.protoc-gen-rust}/bin/protoc-gen-rust";
RUST_BACKTRACE = 1;
NIX_BUILD_CORES = 8;
cargoLock = {
lockFile = ./Cargo.lock;
};
buildInputs = with pkgs; [
];
nativeBuildInputs = with pkgs; [
rust
pkg-config
];
meta = with nixpkgs.lib; {
description = "";
longDescription = ''
'';
homepage = "";
platforms = platforms.all;
};
};
devShell = pkgs.mkShell {
CARGO_BUILD_JOBS=12;
RUST_BACKTRACE="full";
nativeBuildInputs = with pkgs; [
# Extra tools
rust-analyzer
clippy
] ++ packages.ethers.nativeBuildInputs ++ packages.ethers.buildInputs;
};
}
);
}