forked from nervosnetwork/ckb-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.nix
44 lines (37 loc) · 1.61 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ pkgs ? import (builtins.fetchTarball { # 2020-02-13 (nixos-19.09)
url = "https://github.com/NixOS/nixpkgs/archive/e02fb6eaf70d4f6db37ce053edf79b731f13c838.tar.gz";
sha256 = "1dbjbak57vl7kcgpm1y1nm4s74gjfzpfgk33xskdxj9hjphi6mws";
}) {}
, fetch ? { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
if !fetchSubmodules && !private then builtins.fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
} else (import <nixpkgs> {}).fetchFromGitHub {
inherit owner repo rev sha256 fetchSubmodules private;
}
, rustOverlay ? import
"${fetch (builtins.fromJSON (builtins.readFile ./nix/nixpkgs-mozilla/github.json))}/rust-overlay.nix"
pkgs
pkgs
# Rust manifest hash must be updated when rust-toolchain file changes.
, rustPackages ? rustOverlay.rustChannelOf {
date = "2020-05-04";
rustToolchain = ./rust-toolchain;
sha256 = "sha256-Pj5c6sufuY0IZg/NwiVUqOB0z85OlLDrGbWyYYk9tx4=";
}
, gitignoreNix ? fetch (builtins.fromJSON (builtins.readFile ./nix/gitignore.nix/github.json))
}:
let
rustPlatform = pkgs.makeRustPlatform {
inherit (rustPackages) cargo;
rustc = rustPackages.rust;
};
inherit (import gitignoreNix { inherit (pkgs) lib; }) gitignoreSource;
in rustPlatform.buildRustPackage {
name = "ckb-cli";
src = gitignoreSource ./.;
nativeBuildInputs = [ pkgs.pkgconfig ];
buildInputs = [ rustPackages.rust-std pkgs.openssl pkgs.libudev ];
verifyCargoDeps = true;
# Cargo hash must be updated when Cargo.lock file changes.
cargoSha256 = "1zipp3hpzj5m9hybi73zpzsxyrmglillz97kwasyf4c1n6lx55y9";
}