Skip to content

Commit 7fe252f

Browse files
committed
build(erigon-portable): Add variant that compiles BLST in portable mode
1 parent 4f9aa14 commit 7fe252f

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

modules/erigon/default.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ in {
102102
${concatStringsSep " \\\n" filteredArgs} \
103103
${lib.escapeShellArgs cfg.extraArgs}
104104
'';
105+
106+
package =
107+
if cfg.blst-portable
108+
then pkgs.erigon-blst-portable
109+
else cfg.package;
105110
in
106111
nameValuePair serviceName (mkIf cfg.enable {
107112
description = "Erigon Ethereum node (${erigonName})";
@@ -117,7 +122,7 @@ in {
117122
ExecStartPre = mkIf cfg.subVolume (mkBefore [
118123
"+${scripts.setupSubVolume} /var/lib/private/${serviceName}"
119124
]);
120-
ExecStart = "${cfg.package}/bin/erigon ${scriptArgs}";
125+
ExecStart = "${package}/bin/erigon ${scriptArgs}";
121126
}
122127
(mkIf (cfg.args.authrpc.jwtsecret != null) {
123128
LoadCredential = ["jwtsecret:${cfg.args.authrpc.jwtsecret}"];

modules/erigon/options.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
default = [];
2020
};
2121

22+
blst-portable = mkOption {
23+
type = types.bool;
24+
default = false;
25+
description = lib.mdDoc "Make blst library used by erigon build in portable mode. When this option is enabled, the package option is ignored.";
26+
};
27+
2228
package = mkOption {
2329
type = types.package;
2430
default = pkgs.erigon;

pkgs/default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
dreamboat = callPackage ./dreamboat {inherit blst;};
3333
eigenlayer = callPackage ./eigenlayer {};
3434
erigon = callPackage ./erigon {};
35+
erigon-blst-portable = erigon.overrideAttrs (_finalAttrs: _previousAttrs: {
36+
CGO_CFLAGS = "-O -D__BLST_PORTABLE__";
37+
});
3538
eth2-testnet-genesis = callPackage ./eth2-testnet-genesis {inherit bls;};
3639
eth2-val-tools = callPackage ./eth2-val-tools {inherit bls mcl;};
3740
ethdo = callPackage ./ethdo {inherit bls mcl;};

0 commit comments

Comments
 (0)