Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lighthouse: add package option to service #285005

Merged
merged 6 commits into from
Nov 1, 2024

Conversation

rolfschr
Copy link
Contributor

@rolfschr rolfschr commented Jan 30, 2024

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@rolfschr rolfschr force-pushed the lighthouse-service-add-package branch from 20f14a1 to 6b3b48c Compare February 3, 2024 05:46
@rolfschr rolfschr marked this pull request as ready for review February 4, 2024 07:08
@rolfschr
Copy link
Contributor Author

rolfschr commented Feb 4, 2024

@ritave Do you mind having a look into this?

EDIT: @centromere @philipmw Since you are the lighthouse package maintainers, maybe you could look into this, too?

@centromere
Copy link
Member

@rolfschr LGTM.

@rolfschr
Copy link
Contributor Author

rolfschr commented Mar 3, 2024

Can we merge this?

@@ -207,12 +207,19 @@ in {
default = "";
example = "";
};

package = mkOption {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mkPackageOption will be nicer here

Copy link
Member

@Frontear Frontear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using lib.getExe is greatly preferred as it makes any possible changes forwards-compatible, otherwise great job, hopefully we can get this merged asap.

@@ -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 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
${cfg.package}/bin/lighthouse beacon_node \
${lib.getExe cfg.package} beacon_node \

@@ -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 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
${cfg.package}/bin/lighthouse validator_client \
${lib.getExe cfg.package} validator_client \

@rolfschr
Copy link
Contributor Author

Okay, thanks for the additinal input. I updated the branch accordingly and aslo applied nixfmt. I'm happy to manipulate the git history upon request.

@rolfschr
Copy link
Contributor Author

Ah, I realize something is wrong (it doesn't build). I had not run anything locally. Will look into this 🤷 .

@rolfschr rolfschr force-pushed the lighthouse-service-add-package branch from 463874a to 6b5d6b7 Compare October 31, 2024 06:05
@rolfschr
Copy link
Contributor Author

Fixed my syntax error

diff --git a/nixos/modules/services/blockchain/ethereum/lighthouse.nix b/nixos/modules/services/blockchain/ethereum/lighthouse.nix
index 2c5e3d2bff7f..247174028adc 100644
--- a/nixos/modules/services/blockchain/ethereum/lighthouse.nix
+++ b/nixos/modules/services/blockchain/ethereum/lighthouse.nix
@@ -216,7 +216,7 @@ in
         example = "";
       };

-      package = lib.mkPackageOption pkgs "lighthouse";
+      package = lib.mkPackageOption pkgs "lighthouse" { };
     };
   };

@r-vdp r-vdp merged commit 3becff6 into NixOS:master Nov 1, 2024
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants