Skip to content

Commit bb70d12

Browse files
committedAug 5, 2021
use normal nixpkgs and custom geth
1 parent 793070d commit bb70d12

File tree

3 files changed

+73
-4
lines changed

3 files changed

+73
-4
lines changed
 

‎default.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{ system ? builtins.currentSystem , ... }:
22

33
let
4-
rev = "3d64b6067f1c457f889e91c59ced273be1d1e4f1";
4+
rev = "aa576357673d609e618d87db43210e49d4bb1789";
55
nixpkgs = builtins.fetchTarball {
66
name = "nixpkgs-release-21.05";
77
url = "https://github.com/nixos/nixpkgs/tarball/${rev}";
8-
sha256 = "0wgmzq2h82wxqh6zkxxxw77rdk75m48rshmjfl3w35pv498wfcwz";
8+
sha256 = "1868s3mp0lwg1jpxsgmgijzddr90bjkncf6k6zhdjqihf0i1n2np";
99
};
1010
in
1111
# Now return the Nixpkgs configured to use our overlay.

‎nix/geth.nix

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{ lib, stdenv, buildGoModule, fetchFromGitHub, libobjc ? null, IOKit ? null }:
2+
3+
let
4+
# A list of binaries to put into separate outputs
5+
bins = [
6+
"geth"
7+
"clef"
8+
];
9+
10+
in buildGoModule rec {
11+
pname = "go-ethereum";
12+
version = "1.10.6";
13+
14+
src = fetchFromGitHub {
15+
owner = "ethereum";
16+
repo = pname;
17+
rev = "v${version}";
18+
sha256 = "sha256-4lapkoxSKdXlD6rmUxnlSKrfH+DeV6/wV05CqJjuzjA=";
19+
};
20+
21+
runVend = true;
22+
vendorSha256 = "sha256-5qi01y0SIEI0WRYu2I2RN94QFS8rrlioFvnRqqp6wtk=";
23+
24+
doCheck = false;
25+
26+
outputs = [ "out" ] ++ bins;
27+
28+
# Move binaries to separate outputs and symlink them back to $out
29+
postInstall = lib.concatStringsSep "\n" (
30+
builtins.map (bin: "mkdir -p \$${bin}/bin && mv $out/bin/${bin} \$${bin}/bin/ && ln -s \$${bin}/bin/${bin} $out/bin/") bins
31+
);
32+
33+
subPackages = [
34+
"cmd/abidump"
35+
"cmd/abigen"
36+
"cmd/bootnode"
37+
"cmd/checkpoint-admin"
38+
"cmd/clef"
39+
"cmd/devp2p"
40+
"cmd/ethkey"
41+
"cmd/evm"
42+
"cmd/faucet"
43+
"cmd/geth"
44+
"cmd/p2psim"
45+
"cmd/puppeth"
46+
"cmd/rlpdump"
47+
"cmd/utils"
48+
];
49+
50+
# Fix for usb-related segmentation faults on darwin
51+
propagatedBuildInputs =
52+
lib.optionals stdenv.isDarwin [ libobjc IOKit ];
53+
54+
meta = with lib; {
55+
homepage = "https://geth.ethereum.org/";
56+
description = "Official golang implementation of the Ethereum protocol";
57+
license = with licenses; [ lgpl3Plus gpl3Plus ];
58+
maintainers = with maintainers; [ adisbladis lionello xrelkd RaghavSood ];
59+
};
60+
}

‎overlay.nix

+11-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,17 @@ in rec {
118118

119119
# We use this to run private testnets without
120120
# the pesky transaction size limit.
121-
go-ethereum-unlimited = super.go-ethereum.overrideAttrs (geth: rec {
122-
name = "${geth.pname}-unlimited-${geth.version}";
121+
go-ethereum-unlimited = (self.callPackage (import ./nix/geth.nix) {}).overrideAttrs (geth: rec {
122+
version = "1.10.7";
123+
124+
src = super.fetchFromGitHub {
125+
owner = "ethereum";
126+
repo = "go-ethereum";
127+
rev = "v${version}";
128+
sha256 = "0a4l3xisw7d80l1plqk1rwzxiffwvwsvcm1345hzz2xpmxpkd6y4";
129+
};
130+
131+
name = "${geth.pname}-unlimited-${version}";
123132
preConfigure = ''
124133
# Huge transaction calldata
125134
substituteInPlace core/tx_pool.go --replace 'return ErrOversizedData' ""

0 commit comments

Comments
 (0)
Please sign in to comment.