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

nodeinfo: make extensible #503

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

erikarvstedt
Copy link
Collaborator

@erikarvstedt erikarvstedt commented Jul 4, 2022

Copy of commit msg

Module authors can now add extra services via option nix-bitcoin.nodeinfo.services.
Mark as internal because we're not yet providing a user-friendly, stable API.

Test this with:

read -d '' config <<'EOF' || :
{ config, ... }: {
  options = {
    services.myservice.enable = mkOption { default = true; };
  };

  config = {
    services.electrs.enable = true;
    services.clightning.enable = true;

    nix-bitcoin.nodeinfo = {
      enable = true;
      services = {
        myservice = _: _: ''
          infos["myservice"] = "example output"
        '';
      };
    };
  };
}
EOF
run-tests.sh -s "$config" container --run c nodeinfo

@erikarvstedt erikarvstedt force-pushed the nodeinfo-extensible branch from 70fc434 to 55a1ade Compare July 5, 2022 08:11
Module authors can now add extra services via option `nix-bitcoin.nodeinfo.services`.
Mark as internal because we're not yet providing a user-friendly, stable API.
@erikarvstedt erikarvstedt force-pushed the nodeinfo-extensible branch from 55a1ade to f17fceb Compare July 5, 2022 08:12
Copy link
Member

@jonasnick jonasnick left a comment

Choose a reason for hiding this comment

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

That's pretty nice!

ACK f17fceb

@jonasnick jonasnick merged commit 4c9efa9 into fort-nix:master Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants