Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

99 lines
2.0 KiB
Nix
Raw Permalink Normal View History

2024-12-28 13:39:18 -08:00
{
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
2025-06-16 15:45:48 -07:00
buildGoModule (finalAttrs: {
2024-12-28 13:39:18 -08:00
pname = "albyhub";
2025-08-01 08:14:54 +00:00
version = "1.18.5";
2024-12-28 13:39:18 -08:00
src = fetchFromGitHub {
owner = "getAlby";
repo = "hub";
2025-06-16 15:45:48 -07:00
tag = "v${finalAttrs.version}";
2025-08-01 08:14:54 +00:00
hash = "sha256-j918jzhQs3dnPQaG4UMmoit8UvC8/3Z5+IiAZqO3OSA=";
2024-12-28 13:39:18 -08:00
};
2025-08-01 08:14:54 +00:00
vendorHash = "sha256-iMxxJQZLQOLl7v1SimtXSYH7wXFOdZcSJAaUAKDqvBY=";
2024-12-28 13:39:18 -08:00
proxyVendor = true; # needed for secp256k1-zkp CGO bindings
nativeBuildInputs = [
fixup-yarn-lock
nodejs
yarn
makeWrapper
];
buildInputs = [
ldkNodeGo
(lib.getLib stdenv.cc.cc)
];
frontendYarnOfflineCache = fetchYarnDeps {
2025-06-16 15:45:48 -07:00
yarnLock = finalAttrs.src + "/frontend/yarn.lock";
2025-07-16 15:05:29 -07:00
hash = "sha256-ttLhICDAsg8Cvqy2AJKgS2IJZgay1tMi3Qd8RccD1jI=";
2024-12-28 13:39:18 -08:00
};
preBuild = ''
export HOME=$TMPDIR
pushd frontend
fixup-yarn-lock yarn.lock
2025-06-16 15:45:48 -07:00
yarn config set yarn-offline-mirror "${finalAttrs.frontendYarnOfflineCache}"
2024-12-28 13:39:18 -08:00
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 = [
2025-06-16 15:45:48 -07:00
"-X github.com/getAlby/hub/version.Tag=v${finalAttrs.version}"
2024-12-28 13:39:18 -08:00
"-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";
};
2025-06-16 15:45:48 -07:00
})