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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
{ lib
, stdenv
, pkg-config
, attr
, libuuid
, libsodium
, keyutils
, liburcu
, zlib
, libaio
, udev
, zstd
, lz4
, nix-gitignore
, rustPlatform
, rustc
, cargo
}:
let
src = nix-gitignore.gitignoreSource [] ./. ;
commit = lib.strings.substring 0 7 (builtins.readFile ./.bcachefs_revision);
version = "git-${commit}";
in stdenv.mkDerivation {
inherit src version;
pname = "bcachefs-tools";
nativeBuildInputs = [
pkg-config
cargo
rustc
rustPlatform.cargoSetupHook
rustPlatform.bindgenHook
];
buildInputs = [
libaio
keyutils # libkeyutils
lz4 # liblz4
libsodium
liburcu
libuuid
zstd # libzstd
zlib # zlib1g
attr
udev
];
cargoRoot = "rust-src";
# when git-based crates are updated, run:
# nix run github:Mic92/nix-update -- --version=skip --flake default
# to update the hashes
cargoDeps = rustPlatform.importCargoLock {
lockFile = "${src}/rust-src/Cargo.lock";
outputHashes = {
"bindgen-0.64.0" = "sha256-GNG8as33HLRYJGYe0nw6qBzq86aHiGonyynEM7gaEE4=";
};
};
makeFlags = [
"PREFIX=${placeholder "out"}"
"VERSION=${commit}"
];
dontStrip = true;
checkPhase = "./bcachefs version";
doCheck = true;
}
|