2020-09-25 04:45:31 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchurl, linkFarmFromDrvs, makeWrapper,
|
|
|
|
dotnetPackages, dotnetCorePackages
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
deps = import ./deps.nix {
|
|
|
|
fetchNuGet = { name, version, sha256 }: fetchurl {
|
|
|
|
name = "nuget-${name}-${version}.nupkg";
|
|
|
|
url = "https://www.nuget.org/api/v2/package/${name}/${version}";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
dotnetSdk = dotnetCorePackages.sdk_3_1;
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nbxplorer";
|
2020-12-03 08:41:04 +00:00
|
|
|
version = "2.1.46";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dgarage";
|
|
|
|
repo = "NBXplorer";
|
|
|
|
rev = "v${version}";
|
2020-12-03 08:41:04 +00:00
|
|
|
sha256 = "1aph7yiwmch7s7x1qkzqv1shs3v6kg8i2s7266la0yp9ksf3w35p";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ dotnetSdk dotnetPackages.Nuget makeWrapper ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
export HOME=$TMP/home
|
|
|
|
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
|
|
|
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
|
|
|
|
|
|
|
nuget sources Add -Name tmpsrc -Source $TMP/nuget
|
|
|
|
nuget init ${linkFarmFromDrvs "deps" deps} $TMP/nuget
|
|
|
|
|
|
|
|
dotnet restore --source $TMP/nuget NBXplorer/NBXplorer.csproj
|
|
|
|
dotnet publish --no-restore --output $out/share/$pname -c Release NBXplorer/NBXplorer.csproj
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
makeWrapper $out/share/$pname/NBXplorer $out/bin/$pname \
|
|
|
|
--set DOTNET_ROOT "${dotnetSdk}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Minimalist UTXO tracker for HD Cryptocurrency Wallets";
|
|
|
|
maintainers = with maintainers; [ kcalvinalvin earvstedt ];
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|