electrs: enable unstable build, pin pkg to unstable

stable's buildRustPackage is painfully slow when evaluating (adds >1 sec
even on a fast machine).

This is fixed (https://github.com/NixOS/nixpkgs/pull/69274) in unstable.
This commit is contained in:
Erik Arvstedt 2020-03-04 18:08:56 +01:00
parent 5c6571654e
commit f30aadbef2
No known key found for this signature in database
GPG Key ID: 33312B944DD97846
2 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,4 @@
{ lib, rustPlatform, clang, llvmPackages, fetchFromGitHub }:
{ lib, rustPlatform, clang, llvmPackages, fetchFromGitHub, pkgs }:
rustPlatform.buildRustPackage rec {
pname = "electrs";
version = "0.8.3";
@ -14,7 +14,12 @@ rustPlatform.buildRustPackage rec {
buildInputs = [ clang ];
LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
cargoSha256 = "19qs8if8fmygv6j74s6iwzm534fybwasjvmzdqcl996xhg75w6gi";
cargoSha256 = if pkgs ? cargo-vendor then
# nixpkgs ≤ 19.09
"19qs8if8fmygv6j74s6iwzm534fybwasjvmzdqcl996xhg75w6gi"
else
# for recent nixpkgs with cargo-native vendoring (introduced in nixpkgs PR #69274)
"1x88zj7p4i7pfb25ch1a54sawgimq16bfcsz1nmzycc8nbwbf493";
meta = with lib; {
description = "An efficient Electrum Server in Rust";

View File

@ -1,6 +1,7 @@
let
nixpkgsPinned = import ./nixpkgs-pinned.nix;
unstable = import nixpkgsPinned.nixpkgs-unstable { config = {}; overlays = []; };
nixBitcoinPkgsUnstable = import ./. { pkgs = unstable; };
in
{
bitcoin = unstable.bitcoin.override { miniupnpc = null; };
@ -8,4 +9,5 @@ in
inherit (unstable)
clightning
lnd;
inherit (nixBitcoinPkgsUnstable) electrs;
}