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 ${if fuseSupport then "BCACHEFS_FUSE" else null} = "1";
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}/Cargo.lock";
46 makeFlags = [ "DESTDIR=${placeholder "out"}" "PREFIX=" "VERSION=${commit}" ];
49 checkPhase = "./target/release/bcachefs version";
53 mainProgram = "bcachefs";
54 license = lib.licenses.gpl2Only;