1 { rustPlatform, lib, fetchFromGitHub
5 rustPlatform.buildRustPackage rec {
9 # https://github.com/near/nearcore/tags
10 src = fetchFromGitHub {
13 # there is also a branch for this version number, so we need to be explicit
14 rev = "refs/tags/${version}";
16 sha256 = "sha256-VjvHCiWjsx5Y7xxqck/O9gSNrL8mxCTosLwLqC85ywY=";
19 cargoHash = "sha256-5Gs1sAzjuUO3IkwMX1NeA/Sbax0qtwvulyT66AQaNjs=";
20 cargoPatches = [ ./0001-make-near-test-contracts-optional.patch ];
23 substituteInPlace neard/build.rs \
24 --replace 'get_git_version()?' '"nix:${version}"'
27 CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "1";
28 CARGO_PROFILE_RELEASE_LTO = "fat";
29 NEAR_RELEASE_BUILD = "release";
31 OPENSSL_NO_VENDOR = 1; # we want to link to OpenSSL provided by Nix
33 # don't build SDK samples that require wasm-enabled rust
34 buildAndTestSubdir = "neard";
35 doCheck = false; # needs network
45 rustPlatform.bindgenHook
48 # fat LTO requires ~3.4GB RAM
49 requiredSystemFeatures = [ "big-parallel" ];
52 description = "Reference client for NEAR Protocol";
53 homepage = "https://github.com/near/nearcore";
54 license = licenses.gpl3;
55 maintainers = with maintainers; [ mikroskeem ];
56 # only x86_64 is supported in nearcore because of sse4+ support, macOS might
58 platforms = [ "x86_64-linux" ];