From f30aadbef26c406d3fb43f1cc583e4b57c72da79 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Wed, 4 Mar 2020 18:08:56 +0100 Subject: [PATCH] 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. --- pkgs/electrs/default.nix | 9 +++++++-- pkgs/pinned.nix | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/electrs/default.nix b/pkgs/electrs/default.nix index 48dad0f..512d0b7 100644 --- a/pkgs/electrs/default.nix +++ b/pkgs/electrs/default.nix @@ -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"; diff --git a/pkgs/pinned.nix b/pkgs/pinned.nix index 4a5e104..5bc69ac 100644 --- a/pkgs/pinned.nix +++ b/pkgs/pinned.nix @@ -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; }