clboss: deprecate, add clighting 23.05 compatibility

This commit is contained in:
Erik Arvstedt
2023-05-26 13:51:20 +02:00
committed by Jonas Nick
parent dcc5a543ae
commit 2166bfd1ee
3 changed files with 33 additions and 1 deletions

View File

@@ -12,6 +12,11 @@ let cfg = config.services.clightning.plugins.clboss; in
See also: https://github.com/ZmnSCPxj/clboss#operating See also: https://github.com/ZmnSCPxj/clboss#operating
''; '';
}; };
acknowledgeDeprecation = mkOption {
type = types.bool;
default = false;
internal = true;
};
min-onchain = mkOption { min-onchain = mkOption {
type = types.ints.positive; type = types.ints.positive;
default = 30000; default = 30000;
@@ -49,6 +54,22 @@ let cfg = config.services.clightning.plugins.clboss; in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
assertions = [
{
assertion = cfg.acknowledgeDeprecation;
message = ''
`clboss` is no longer maintained and has been deprecated.
Warning: For compatibility with clighting 23.05, the nix-bitcoin `clboss` package
includes a third-party fix that has not been thoroughly tested:
https://github.com/ZmnSCPxj/clboss/pull/162
To ignore this warning and continue using `clboss`, add the following to your config:
services.clightning.plugins.clboss.acknowledgeDeprecation = true;
'';
}
];
services.clightning.extraConfig = '' services.clightning.extraConfig = ''
plugin=${cfg.package}/bin/clboss plugin=${cfg.package}/bin/clboss
clboss-min-onchain=${toString cfg.min-onchain} clboss-min-onchain=${toString cfg.min-onchain}
@@ -56,6 +77,7 @@ let cfg = config.services.clightning.plugins.clboss; in
clboss-max-channel=${toString cfg.max-channel} clboss-max-channel=${toString cfg.max-channel}
clboss-zerobasefee=${cfg.zerobasefee} clboss-zerobasefee=${cfg.zerobasefee}
''; '';
systemd.services.clightning.path = [ systemd.services.clightning.path = [
pkgs.dnsutils pkgs.dnsutils
] ++ optional config.services.clightning.tor.proxy (hiPrio config.nix-bitcoin.torify); ] ++ optional config.services.clightning.tor.proxy (hiPrio config.nix-bitcoin.torify);

View File

@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, pkgconfig, curl, libev, sqlite }: { lib, stdenv, fetchurl, fetchpatch, pkgconfig, curl, libev, sqlite }:
let let
curlWithGnuTLS = curl.override { gnutlsSupport = true; opensslSupport = false; }; curlWithGnuTLS = curl.override { gnutlsSupport = true; opensslSupport = false; };
@@ -12,6 +12,15 @@ stdenv.mkDerivation rec {
hash = "sha256-LTDJrm9Mk4j7Z++tKJKawEurgF1TnYuIoj+APbDHll4="; hash = "sha256-LTDJrm9Mk4j7Z++tKJKawEurgF1TnYuIoj+APbDHll4=";
}; };
patches = [
# https://github.com/ZmnSCPxj/clboss/pull/162, required for clighting 23.05
(fetchpatch {
name = "fix-json-rpc";
url = "https://github.com/ZmnSCPxj/clboss/commit/a4bb0192550803db3d07628a29284a76f7204365.patch";
sha256 = "sha256-1iBJlOnt7n2xXNDgzH3PAvLryZcpM4VWNaWcEegbapQ=";
})
];
nativeBuildInputs = [ pkgconfig libev curlWithGnuTLS sqlite ]; nativeBuildInputs = [ pkgconfig libev curlWithGnuTLS sqlite ];
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@@ -145,6 +145,7 @@ let
(mkIf config.test.features.clightningPlugins { (mkIf config.test.features.clightningPlugins {
services.clightning.plugins = { services.clightning.plugins = {
clboss.enable = true; clboss.enable = true;
clboss.acknowledgeDeprecation = true;
feeadjuster.enable = true; feeadjuster.enable = true;
helpme.enable = true; helpme.enable = true;
monitor.enable = true; monitor.enable = true;