From ac86e67c85e0cde22bb2c0dfd963f23ff9fbe76c Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Thu, 8 May 2025 23:58:27 +0200 Subject: [PATCH] clnrest: init at 0.2.0 --- pkgs/clnrest/default.nix | 43 ++++++++++++++++++++++++++++++++++++++++ pkgs/default.nix | 1 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/clnrest/default.nix diff --git a/pkgs/clnrest/default.nix b/pkgs/clnrest/default.nix new file mode 100644 index 0000000..e5e9c7b --- /dev/null +++ b/pkgs/clnrest/default.nix @@ -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"; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix index 66b92ad..5fc1ccf 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -12,6 +12,7 @@ in let self = { clightning-rest = pkgs.callPackage ./clightning-rest { inherit (self) fetchNodeModules; }; 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; }; lndinit = pkgs.callPackage ./lndinit { }; liquid-swap = pkgs.python3Packages.callPackage ./liquid-swap { };