Merge fort-nix/nix-bitcoin#772: update nixpkgs
411b131c3atest: remove clightning plugin start timeout patch (Erik Arvstedt)815f2cd325clightning: don't set `datadir` for `bitcoin-cli` plugin (Erik Arvstedt)04b6a09be4clightning-plugins: use `clnrest`, remove Python version (Erik Arvstedt)ac86e67c85clnrest: init at 0.2.0 (Erik Arvstedt)6e3c5db5f5update nixpkgs (Jonas Nick) Pull request description: ACKs for top commit: erikarvstedt: ACK411b131c3aTree-SHA512: 8dd521079d76b75d4db5cbb94d622fe4713b52cf2ffe196d997838c918ba0d07622e5ae5789851c38520dcbd00f24c4657d04a82b21342adb0bb52eca609664d
This commit is contained in:
commit
b2bc5e6e75
10 changed files with 66 additions and 97 deletions
12
flake.lock
generated
12
flake.lock
generated
|
|
@ -44,11 +44,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1742937945,
|
"lastModified": 1746422338,
|
||||||
"narHash": "sha256-lWc+79eZRyvHp/SqMhHTMzZVhpxkRvthsP1Qx6UCq0E=",
|
"narHash": "sha256-NTtKOTLQv6dPfRe00OGSywg37A1FYqldS6xiNmqBUYc=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "d02d88f8de5b882ccdde0465d8fa2db3aa1169f7",
|
"rev": "5b35d248e9206c1f3baf8de6a7683fee126364aa",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -60,11 +60,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1742923925,
|
"lastModified": 1746332716,
|
||||||
"narHash": "sha256-biPjLws6FiBVUUDHEMFq5pUQL84Wf7PntPYdo3oKkFw=",
|
"narHash": "sha256-VBmKSkmw9PYBCEGhBKzORjx+nwNZkPZyHcUHE21A/ws=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "25d1b84f5c90632a623c48d83a2faf156451e6b1",
|
"rev": "6b1c028bce9c89e9824cde040d6986d428296055",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ let
|
||||||
};
|
};
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = config.nix-bitcoin.pkgs.nbPython3Packages.clnrest;
|
default = config.nix-bitcoin.pkgs.clnrest;
|
||||||
defaultText = "config.nix-bitcoin.pkgs.nbPython3Packages.clnrest";
|
defaultText = "config.nix-bitcoin.pkgs.clnrest";
|
||||||
description = "The package providing clnrest binaries.";
|
description = "The package providing clnrest binaries.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -116,13 +116,7 @@ let
|
||||||
network = bitcoind.makeNetworkName "bitcoin" "regtest";
|
network = bitcoind.makeNetworkName "bitcoin" "regtest";
|
||||||
configFile = pkgs.writeText "config" ''
|
configFile = pkgs.writeText "config" ''
|
||||||
network=${network}
|
network=${network}
|
||||||
${
|
${optionalString (!cfg.useBcliPlugin) "disable-plugin=bcli"}
|
||||||
if cfg.useBcliPlugin then ''
|
|
||||||
bitcoin-datadir=${config.services.bitcoind.dataDir}
|
|
||||||
'' else ''
|
|
||||||
disable-plugin=bcli
|
|
||||||
''
|
|
||||||
}
|
|
||||||
${optionalString (cfg.proxy != null) "proxy=${cfg.proxy}"}
|
${optionalString (cfg.proxy != null) "proxy=${cfg.proxy}"}
|
||||||
always-use-proxy=${boolToString cfg.always-use-proxy}
|
always-use-proxy=${boolToString cfg.always-use-proxy}
|
||||||
bind-addr=${cfg.address}:${toString cfg.port}
|
bind-addr=${cfg.address}:${toString cfg.port}
|
||||||
|
|
|
||||||
43
pkgs/clnrest/default.nix
Normal file
43
pkgs/clnrest/default.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
rustPlatform,
|
||||||
|
clightning,
|
||||||
|
unzip,
|
||||||
|
protobuf,
|
||||||
|
}:
|
||||||
|
rustPlatform.buildRustPackage rec {
|
||||||
|
pname = "clnrest";
|
||||||
|
version = "0.2.0";
|
||||||
|
|
||||||
|
inherit (clightning) src;
|
||||||
|
|
||||||
|
cargoHash = "sha256-rXOpRNzIDohfvn3n1xEhc/C1pCpzgfFXHjob7/qOeXM=";
|
||||||
|
|
||||||
|
depsExtraArgs = {
|
||||||
|
nativeBuildInputs = [ unzip ];
|
||||||
|
# Don't run `configure` of the main project build
|
||||||
|
dontConfigure = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
# For unpacking the src
|
||||||
|
unzip
|
||||||
|
];
|
||||||
|
|
||||||
|
cargoBuildFlags = [ "--package clnrest" ];
|
||||||
|
|
||||||
|
nativeCheckInputs = [
|
||||||
|
# Required by lightning/cln-grpc/build.rs
|
||||||
|
protobuf
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "REST plugin for clightning";
|
||||||
|
homepage = "https://github.com/ElementsProject/lightning/tree/master/plugins/rest-plugin";
|
||||||
|
license = licenses.mit;
|
||||||
|
maintainers = with maintainers; [
|
||||||
|
erikarvstedt
|
||||||
|
];
|
||||||
|
mainProgram = "clnrest";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -12,6 +12,7 @@ in
|
||||||
let self = {
|
let self = {
|
||||||
clightning-rest = pkgs.callPackage ./clightning-rest { inherit (self) fetchNodeModules; };
|
clightning-rest = pkgs.callPackage ./clightning-rest { inherit (self) fetchNodeModules; };
|
||||||
clightning-plugins = pkgs.recurseIntoAttrs (import ./clightning-plugins pkgs self.nbPython3Packages);
|
clightning-plugins = pkgs.recurseIntoAttrs (import ./clightning-plugins pkgs self.nbPython3Packages);
|
||||||
|
clnrest = pkgs.callPackage ./clnrest { inherit (self.pinned) clightning; };
|
||||||
joinmarket = pkgs.callPackage ./joinmarket { inherit (self) nbPython3PackagesJoinmarket; };
|
joinmarket = pkgs.callPackage ./joinmarket { inherit (self) nbPython3PackagesJoinmarket; };
|
||||||
lndinit = pkgs.callPackage ./lndinit { };
|
lndinit = pkgs.callPackage ./lndinit { };
|
||||||
liquid-swap = pkgs.python3Packages.callPackage ./liquid-swap { };
|
liquid-swap = pkgs.python3Packages.callPackage ./liquid-swap { };
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ pkgs: pkgsUnstable:
|
||||||
{
|
{
|
||||||
inherit (pkgs)
|
inherit (pkgs)
|
||||||
charge-lnd
|
charge-lnd
|
||||||
fulcrum
|
extra-container
|
||||||
hwi
|
hwi
|
||||||
lightning-loop
|
lightning-loop
|
||||||
lightning-pool
|
lightning-pool
|
||||||
|
|
@ -17,7 +17,7 @@ pkgs: pkgsUnstable:
|
||||||
clightning
|
clightning
|
||||||
electrs
|
electrs
|
||||||
elementsd
|
elementsd
|
||||||
extra-container
|
fulcrum
|
||||||
lnd
|
lnd
|
||||||
nbxplorer;
|
nbxplorer;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
{ buildPythonPackage
|
|
||||||
, clightning
|
|
||||||
, python
|
|
||||||
, poetry-core
|
|
||||||
, flask
|
|
||||||
, flask-cors
|
|
||||||
, flask-restx
|
|
||||||
, flask-socketio
|
|
||||||
, gevent
|
|
||||||
, gevent-websocket
|
|
||||||
, gunicorn
|
|
||||||
, pyln-client
|
|
||||||
, json5
|
|
||||||
, jsonschema
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
self = buildPythonPackage rec {
|
|
||||||
pname = "clnrest";
|
|
||||||
version = clightning.version;
|
|
||||||
format = "pyproject";
|
|
||||||
|
|
||||||
inherit (clightning) src;
|
|
||||||
|
|
||||||
postUnpack = "sourceRoot=$sourceRoot/plugins/clnrest";
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
substituteInPlace pyproject.toml \
|
|
||||||
--replace-fail 'gevent = "^23.9.0.post1"' 'gevent = "24.2.1"' \
|
|
||||||
--replace-fail 'gunicorn = "^21.2.0"' 'gunicorn = "23.0.0"' \
|
|
||||||
--replace-fail 'flask = "^2.3.3"' 'flask = "3.0.3"'
|
|
||||||
|
|
||||||
# Add extra required src files that are missing in pyproject.toml
|
|
||||||
sed -i '/authors/a include = [ { path = "utilities", format = ["sdist", "wheel"] } ]' pyproject.toml
|
|
||||||
'';
|
|
||||||
|
|
||||||
nativeBuildInputs = [ poetry-core ];
|
|
||||||
|
|
||||||
# From https://github.com/ElementsProject/lightning/blob/master/plugins/clnrest/pyproject.toml
|
|
||||||
propagatedBuildInputs = [
|
|
||||||
flask
|
|
||||||
flask-cors
|
|
||||||
flask-restx
|
|
||||||
flask-socketio
|
|
||||||
gevent
|
|
||||||
gevent-websocket
|
|
||||||
gunicorn
|
|
||||||
json5
|
|
||||||
pyln-client
|
|
||||||
];
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
makeWrapper ${python}/bin/python $out/bin/clnrest \
|
|
||||||
--set NIX_PYTHONPATH ${python.pkgs.makePythonPath self.propagatedBuildInputs} \
|
|
||||||
--add-flags "$out/lib/${python.libPrefix}/site-packages/clnrest.py"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
in
|
|
||||||
self
|
|
||||||
|
|
@ -10,7 +10,8 @@ rec {
|
||||||
pyln-proto = clightningPkg ./pyln-proto;
|
pyln-proto = clightningPkg ./pyln-proto;
|
||||||
pyln-bolt7 = clightningPkg ./pyln-bolt7;
|
pyln-bolt7 = clightningPkg ./pyln-bolt7;
|
||||||
pylightning = clightningPkg ./pylightning;
|
pylightning = clightningPkg ./pylightning;
|
||||||
clnrest = clightningPkg ./clnrest;
|
# TODO: Remove after 2026-05-09
|
||||||
|
clnrest = throw "`nbPython3Packages.clnrest` has been replaced with nix-bitcoin pkg `clnrest` (Rust rewrite)";
|
||||||
|
|
||||||
# Packages only used by joinmarket
|
# Packages only used by joinmarket
|
||||||
bencoderpyx = callPackage ./bencoderpyx {};
|
bencoderpyx = callPackage ./bencoderpyx {};
|
||||||
|
|
|
||||||
18
test/nixos-search/flake.lock
generated
18
test/nixos-search/flake.lock
generated
|
|
@ -21,11 +21,11 @@
|
||||||
"nixos-infra": {
|
"nixos-infra": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741456091,
|
"lastModified": 1746309510,
|
||||||
"narHash": "sha256-l7T5FJyQZz2cRnLrKQGl17Tdk8qHhYJHiwLmSGnGTb4=",
|
"narHash": "sha256-zp+318bDhi4/3rLk6uv8hWxQAbutoYMXk5B4Wzws02g=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "infra",
|
"repo": "infra",
|
||||||
"rev": "c6f24c9bf8fc7a15828f196ff141fd8a72c41716",
|
"rev": "59f6670f2ef35c66c78c05edd487eeb701d2f5f4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -43,11 +43,11 @@
|
||||||
"npmlock2nix": "npmlock2nix"
|
"npmlock2nix": "npmlock2nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741681923,
|
"lastModified": 1746437871,
|
||||||
"narHash": "sha256-x08XAFJmmLO4AveUO7tgKNdDXIVv3vHi09D7Eh3jAbM=",
|
"narHash": "sha256-/nEYTmlqRS8JNGZqFJiUndUI4541jpz30tAYDX9RPRA=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixos-search",
|
"repo": "nixos-search",
|
||||||
"rev": "753861364543ae8949fcce0c43fdd0c3e3b5b9d1",
|
"rev": "b270e843f087f65c3d079953de15d53d7fb7aaa9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -58,11 +58,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741379970,
|
"lastModified": 1746232882,
|
||||||
"narHash": "sha256-Wh7esNh7G24qYleLvgOSY/7HlDUzWaL/n4qzlBePpiw=",
|
"narHash": "sha256-MHmBH2rS8KkRRdoU/feC/dKbdlMkcNkB5mwkuipVHeQ=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "36fd87baa9083f34f7f5027900b62ee6d09b1f2f",
|
"rev": "7a2622e2c0dbad5c4493cb268aba12896e28b008",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -271,17 +271,6 @@ let
|
||||||
scenarios.secureNode
|
scenarios.secureNode
|
||||||
../modules/presets/hardened-extended.nix
|
../modules/presets/hardened-extended.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Patch clightning to increase the plugin init timeout.
|
|
||||||
# Otherwise this test can fail on slower hardware.
|
|
||||||
nix-bitcoin.pkgOverlays = super: self: {
|
|
||||||
clightning = super.clightning.overrideAttrs (old: {
|
|
||||||
postPatch = old.postPatch + ''
|
|
||||||
substituteInPlace lightningd/plugin.c \
|
|
||||||
--replace-fail "#define PLUGIN_MANIFEST_TIMEOUT 60" "#define PLUGIN_MANIFEST_TIMEOUT 200"
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
netnsBase = { config, pkgs, ... }: {
|
netnsBase = { config, pkgs, ... }: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue