Skip to content

Commit

Permalink
lighthouse: add package option to service
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfschr committed Feb 3, 2024
1 parent 8f2659f commit 6b3b48c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions nixos/modules/services/blockchain/ethereum/lighthouse.nix
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,19 @@ in {
default = "";
example = "";
};

package = mkOption {
type = types.package;
default = pkgs.lighthouse;
defaultText = literalExpression "pkgs.lighthouse";
description = lib.mdDoc "The lighthouse package that should be used.";
};
};
};

config = mkIf (cfg.beacon.enable || cfg.validator.enable) {

environment.systemPackages = [ pkgs.lighthouse ] ;
environment.systemPackages = [ cfg.package ] ;

networking.firewall = mkIf cfg.beacon.enable {
allowedTCPPorts = mkIf cfg.beacon.openFirewall [ cfg.beacon.port ];
Expand All @@ -229,7 +236,7 @@ in {
# make sure the chain data directory is created on first run
mkdir -p ${cfg.beacon.dataDir}/${cfg.network}
${pkgs.lighthouse}/bin/lighthouse beacon_node \
${cfg.package}/bin/lighthouse beacon_node \
--disable-upnp \
${lib.optionalString cfg.beacon.disableDepositContractSync "--disable-deposit-contract-sync"} \
--port ${toString cfg.beacon.port} \
Expand Down Expand Up @@ -277,7 +284,7 @@ in {
# make sure the chain data directory is created on first run
mkdir -p ${cfg.validator.dataDir}/${cfg.network}
${pkgs.lighthouse}/bin/lighthouse validator_client \
${cfg.package}/bin/lighthouse validator_client \
--network ${cfg.network} \
--beacon-nodes ${lib.concatStringsSep "," cfg.validator.beaconNodes} \
--datadir ${cfg.validator.dataDir}/${cfg.network} \
Expand Down

0 comments on commit 6b3b48c

Please sign in to comment.