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

Update clightning-plugins #488

Merged
merged 2 commits into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions modules/clightning.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,16 @@ let
default = cfg.user;
description = "The group as which to run clightning.";
};
package = mkOption {
type = types.package;
default = nbPkgs.clightning;
defaultText = "config.nix-bitcoin.pkgs.clightning";
description = "The package providing clightning binaries.";
};
cli = mkOption {
readOnly = true;
default = pkgs.writeScriptBin "lightning-cli" ''
${nbPkgs.clightning}/bin/lightning-cli --lightning-dir='${cfg.dataDir}' "$@"
${cfg.package}/bin/lightning-cli --lightning-dir='${cfg.dataDir}' "$@"
'';
defaultText = "(See source)";
description = "Binary to connect with the clightning instance.";
Expand Down Expand Up @@ -120,7 +126,7 @@ in {
rpc.threads = 16;
};

environment.systemPackages = [ nbPkgs.clightning (hiPrio cfg.cli) ];
environment.systemPackages = [ cfg.package (hiPrio cfg.cli) ];

systemd.tmpfiles.rules = [
"d '${cfg.dataDir}' 0770 ${cfg.user} ${cfg.group} - -"
Expand All @@ -144,7 +150,7 @@ in {
} > '${cfg.dataDir}/config'
'';
serviceConfig = nbLib.defaultHardening // {
ExecStart = "${nbPkgs.clightning}/bin/lightningd --lightning-dir=${cfg.dataDir}";
ExecStart = "${cfg.package}/bin/lightningd --lightning-dir=${cfg.dataDir}";
User = cfg.user;
Restart = "on-failure";
RestartSec = "10s";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/clightning-plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ let
src = pkgs.fetchFromGitHub {
owner = "lightningd";
repo = "plugins";
rev = "b88c9278102ea9bffddce8143d31e939b31e835c";
sha256 = "sha256-qf4MYqP2Bwlqqn2y2LCIYuFq71r2m6IFT/w4noW6ePU=";
rev = "7ef9e6c172c0bd0dd09168e19b29e44f7ec6ec4d";
sha256 = "12llf4dnyria0s1x4bmm360d6bxk47z0wyxwwlmq3762mdfl36js";
};

version = builtins.substring 0 7 src.rev;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/clightning-plugins/get-sha256.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ archive_hash () {

echo "Fetching latest lightningd/plugins release"
latest=$(git ls-remote https://github.com/lightningd/plugins master | cut -f 1)
echo "rev: ${latest}"
echo "sha256: $(archive_hash lightningd/plugins $latest)"
echo "rev = \"${latest}\";"
echo "sha256 = \"$(archive_hash lightningd/plugins $latest)\";"