From 041162d1e3b5103039be47581d7249c27282d589 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Sun, 22 May 2022 15:56:14 +0200 Subject: [PATCH 1/2] clightning-plugins: update to latest rev --- pkgs/clightning-plugins/default.nix | 4 ++-- pkgs/clightning-plugins/get-sha256.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/clightning-plugins/default.nix b/pkgs/clightning-plugins/default.nix index bf8443b..49f39c9 100644 --- a/pkgs/clightning-plugins/default.nix +++ b/pkgs/clightning-plugins/default.nix @@ -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; diff --git a/pkgs/clightning-plugins/get-sha256.sh b/pkgs/clightning-plugins/get-sha256.sh index ccc678b..3def505 100755 --- a/pkgs/clightning-plugins/get-sha256.sh +++ b/pkgs/clightning-plugins/get-sha256.sh @@ -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)\";" From ae94665ad18ca3b49f485cce38bb4f2023de3f2e Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Sun, 22 May 2022 15:56:15 +0200 Subject: [PATCH 2/2] clightning: add `package` option --- modules/clightning.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/clightning.nix b/modules/clightning.nix index 32ea647..fd6bc5a 100644 --- a/modules/clightning.nix +++ b/modules/clightning.nix @@ -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."; @@ -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} - -" @@ -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";