1 { lib, stdenv, pkg-config, attr, libuuid, libsodium, keyutils, liburcu, zlib
2 , libaio, udev, zstd, lz4, nix-gitignore, rustPlatform, rustc, cargo, fuse3
3 , fuseSupport ? false, }:
5 src = nix-gitignore.gitignoreSource [ ] ./.;
7 commit = lib.strings.substring 0 7 (builtins.readFile ./.bcachefs_revision);
8 version = "git-${commit}";
9 in stdenv.mkDerivation {
12 pname = "bcachefs-tools";
18 rustPlatform.cargoSetupHook
19 rustPlatform.bindgenHook
24 keyutils # libkeyutils
34 ] ++ lib.optional fuseSupport fuse3;
36 BCACHEFS_FUSE = if fuseSupport then "1" else "";
38 cargoRoot = "rust-src";
39 # when git-based crates are updated, run:
40 # nix run github:Mic92/nix-update -- --version=skip --flake default
41 # to update the hashes
42 cargoDeps = rustPlatform.importCargoLock {
43 lockFile = "${src}/rust-src/Cargo.lock";
45 "bindgen-0.64.0" = "sha256-GNG8as33HLRYJGYe0nw6qBzq86aHiGonyynEM7gaEE4=";
49 makeFlags = [ "DESTDIR=${placeholder "out"}" "PREFIX=" "VERSION=${commit}" ];
52 checkPhase = "./bcachefs version";
56 mainProgram = "bcachefs";
57 license = lib.licenses.gpl2Only;