albyhub: init at 1.17.1

This commit is contained in:
Brian Lee
2025-06-03 12:48:13 -07:00
parent 3fce8baaff
commit 08d3f6944a
3 changed files with 185 additions and 0 deletions
@@ -0,0 +1,39 @@
{
lib,
buildGoModule,
fetchFromGitHub,
ldkNode,
}:
buildGoModule rec {
pname = "ldk-node-go";
version = "0-unstable-2025-05-21";
src = fetchFromGitHub {
owner = "getAlby";
repo = "ldk-node-go";
rev = "ca26307fa2d8ee4d30da9affd0b202897f9919f6";
hash = "sha256-UdsfN6UL9lKPQSCfF8oA89U0M3pqj/TcFcs01E7WoXs=";
};
vendorHash = null;
ldflags = [
"-s"
"-w"
];
buildInputs = [
ldkNode
];
propagatedBuildInputs = [ ldkNode ];
meta = {
description = "Experimental Go bindings for LDK-node";
homepage = "https://github.com/getAlby/ldk-node-go";
license = lib.licenses.asl20;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ bleetube ];
};
}
@@ -0,0 +1,48 @@
{
lib,
rustPlatform,
fetchFromGitHub,
cmake,
llvmPackages,
}:
rustPlatform.buildRustPackage rec {
pname = "ldk-node";
version = "0-unstable-2025-05-21";
src = fetchFromGitHub {
owner = "getAlby";
repo = "ldk-node";
rev = "9bb381ad38dbaa71e17816738789d993158fc1a2";
hash = "sha256-Ie7FOSOd12mwmkEjD4r0p1ZmeYkXm5eN1LlQhWl0VG4=";
};
buildFeatures = [ "uniffi" ];
useFetchCargoVendor = true;
cargoHash = "sha256-hM6VCU0kIg5ZmJM8C4HoybSc/VXNj6GTE/oFLfqGMcY=";
# Skip tests because they download bitcoin-core and electrs zip files, and then fail
doCheck = false;
nativeBuildInputs = [
cmake
llvmPackages.clang
rustPlatform.bindgenHook
];
# Add CFLAGS to suppress the stringop-overflow error during aws-lc-sys compilation.
NIX_CFLAGS_COMPILE = "-Wno-error=stringop-overflow";
meta = {
description = "Embeds the LDK node implementation compiled as shared library objects";
homepage = "https://github.com/getAlby/ldk-node";
changelog = "https://github.com/getAlby/ldk-node/blob/${src.rev}/CHANGELOG.md";
license = with lib.licenses; [
asl20
mit
];
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ bleetube ];
};
}
+98
View File
@@ -0,0 +1,98 @@
{
lib,
buildGoModule,
fetchFromGitHub,
fetchYarnDeps,
fixup-yarn-lock,
nodejs,
pkgs,
yarn,
stdenv,
makeWrapper,
callPackage,
go,
}:
let
ldkNode = callPackage ./ldk-node { };
ldkNodeGo = callPackage ./ldk-node-go {
inherit ldkNode;
};
in
buildGoModule rec {
pname = "albyhub";
version = "1.17.1";
src = fetchFromGitHub {
owner = "getAlby";
repo = "hub";
tag = "v${version}";
hash = "sha256-ZDTCA3nMJEA8I7PeSgwQAe+wU8Wk0GaH3ItQLzPhOBQ=";
};
vendorHash = "sha256-4e75SqQiRUEEjtDZKDZsGSRavZFh5ulJdMz0Ne7gME0=";
proxyVendor = true; # needed for secp256k1-zkp CGO bindings
nativeBuildInputs = [
fixup-yarn-lock
nodejs
yarn
makeWrapper
];
buildInputs = [
ldkNodeGo
(lib.getLib stdenv.cc.cc)
];
frontendYarnOfflineCache = fetchYarnDeps {
yarnLock = src + "/frontend/yarn.lock";
hash = "sha256-SStTJGqeqPvXBKjFMPjKEts+jg6A9Vaqi+rZkr/ytdc=";
};
preBuild = ''
export HOME=$TMPDIR
pushd frontend
fixup-yarn-lock yarn.lock
yarn config set yarn-offline-mirror "${frontendYarnOfflineCache}"
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
patchShebangs node_modules
yarn --offline build:http
popd
'';
subPackages = [
"cmd/http"
];
ldflags = [
"-X github.com/getAlby/hub/version.Tag=v${version}"
"-s"
"-w"
];
postInstall = ''
mv $out/bin/http $out/bin/albyhub
'';
preFixup = ''
patchelf --set-rpath ${
lib.makeLibraryPath [
ldkNode
ldkNodeGo
(lib.getLib stdenv.cc.cc)
]
} $out/bin/albyhub
'';
meta = {
description = "Control lightning wallets over nostr";
homepage = "https://github.com/getAlby/hub";
license = lib.licenses.asl20;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ bleetube ];
mainProgram = "albyhub";
};
}