Skip to content

Commit 4a47712

Browse files
authored
feat: add nimbus (#329)
feat(nimbus): add nimbus
1 parent d655b06 commit 4a47712

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
fetchFromGitHub,
3+
lib,
4+
stdenv,
5+
nim,
6+
lsb-release,
7+
which,
8+
cmake,
9+
writeShellScriptBin,
10+
buildFlags ? ["nimbus_beacon_node"],
11+
}:
12+
stdenv.mkDerivation rec {
13+
pname = "nimbus-eth2";
14+
version = "23.6.0";
15+
16+
src = fetchFromGitHub {
17+
owner = "status-im";
18+
repo = pname;
19+
rev = "v${version}";
20+
hash = "sha256-uAaKKLMlQRklUfTyYmdwI+27evmEEGVE2TFkKuCgAes=";
21+
fetchSubmodules = true;
22+
};
23+
24+
fakeGit = writeShellScriptBin "git" "echo ${version}";
25+
26+
# Dunno why we need `lsb-release`, looks like for nim itself
27+
# without `which` it can't find gcc
28+
nativeBuildInputs = [fakeGit lsb-release nim which cmake];
29+
enableParallelBuilding = true;
30+
31+
NIMFLAGS = "-d:disableMarchNative -d:release";
32+
33+
makeFlags = ["USE_SYSTEM_NIM=1"];
34+
inherit buildFlags;
35+
dontConfigure = true;
36+
37+
preBuild = ''
38+
patchShebangs scripts vendor/nimbus-build-system/scripts
39+
make nimbus-build-system-paths
40+
'';
41+
42+
installPhase = ''
43+
mkdir -p $out/bin
44+
rm -f build/generate_makefile
45+
cp build/* $out/bin
46+
'';
47+
48+
meta = {
49+
description = "Nim implementation of the Ethereum Beacon Chain";
50+
homepage = "https://github.com/status-im/nimbus-eth2";
51+
license = lib.licenses.asl20;
52+
mainProgram = "nimbus_beacon_node";
53+
platforms = ["x86_64-linux"];
54+
};
55+
}

packages/default.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
lighthouse = callPackage ./clients/consensus/lighthouse {inherit foundry;};
2323
prysm = callPackage ./clients/consensus/prysm {inherit bls blst;};
2424
teku = callPackage ./clients/consensus/teku {};
25+
nimbus = callPackage ./clients/consensus/nimbus {};
2526

2627
# Execution Clients
2728
erigon = callPackage ./clients/execution/erigon {};
@@ -89,6 +90,9 @@
8990
# consensus / lighthouse
9091
lighthouse.bin = "lighthouse";
9192

93+
# consensus / nimbus
94+
nimbus.bin = "nimbus_beacon_node";
95+
9296
# execution clients
9397
besu.bin = "besu";
9498
erigon.bin = "erigon";

0 commit comments

Comments
 (0)