Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, stdenv 3, rustPlatform 4, fetchFromGitHub 5, llvmPackages 6, rocksdb_6_23 7, Security 8}: 9 10let 11 rocksdb = rocksdb_6_23; 12in 13rustPlatform.buildRustPackage rec { 14 pname = "electrs"; 15 version = "0.9.13"; 16 17 src = fetchFromGitHub { 18 owner = "romanz"; 19 repo = pname; 20 rev = "v${version}"; 21 hash = "sha256-GV/cwFdYpXJXRTgdVfuzJpmwNhe0kVJnYAJe+DPmRV8="; 22 }; 23 24 cargoHash = "sha256-eQAizO26oQRosbMGJLwMmepBN3pocmnbc0qsHsAJysg="; 25 26 # needed for librocksdb-sys 27 nativeBuildInputs = [ rustPlatform.bindgenHook ]; 28 29 # link rocksdb dynamically 30 ROCKSDB_INCLUDE_DIR = "${rocksdb}/include"; 31 ROCKSDB_LIB_DIR = "${rocksdb}/lib"; 32 33 buildInputs = lib.optionals stdenv.isDarwin [ Security ]; 34 35 passthru.updateScript = ./update.sh; 36 37 meta = with lib; { 38 description = "An efficient re-implementation of Electrum Server in Rust"; 39 homepage = "https://github.com/romanz/electrs"; 40 license = licenses.mit; 41 maintainers = with maintainers; [ prusnak ]; 42 }; 43}