21 , versionString ? "0.1"
26 , testWithValgrind ? true
32 assert fuseSupport -> fuse3 != null;
33 assert testWithValgrind -> valgrind != null;
35 pname = "bcachefs-bin";
37 version = "v0.1-flake-${versionString}";
38 VERSION = "v0.1-flake-${versionString}";
40 src = (lib.cleanSource (builtins.path { name = "bcachefs-tools-src"; path = ./. ;} ));
42 postPatch = "patchShebangs --build doc/macro2rst.py";
44 propagatedNativeBuildInputs = [
45 # used to find dependencies
50 propagatedBuildInputs = [
51 # bcachefs explicit dependencies
56 keyutils # libkeyutils
65 # unspecified dependencies
71 # documentation depenedencies
73 python39Packages.pygments
74 ] ++ (lib.optional fuseSupport fuse3)
75 ++ (lib.optional testWithValgrind valgrind);
78 "PREFIX=${placeholder "out"}"
79 ] ++ lib.optional debugMode "EXTRA_CFLAGS=-ggdb";
82 "INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools"
85 doCheck = doCheck; # needs bcachefs module loaded on builder
88 python39Packages.pytest
89 python39Packages.pytest-xdist
90 ] ++ lib.optional testWithValgrind valgrind;
93 "BCACHEFS_TEST_USE_VALGRIND=${if testWithValgrind then "yes" else "no"}"
94 # cannot escape spaces within make flags, quotes are stripped
95 "PYTEST_CMD=pytest" # "PYTEST_ARGS='-n4 --version'"
100 makeFlagsArray+=(PYTEST_ARGS="--verbose -n2")
102 lib.optionalString fuseSupport ''
103 rm tests/test_fuse.py
106 dontStrip = debugMode;
108 bcachefs_revision = let
109 file = builtins.readFile ./.bcachefs_revision;
110 removeLineFeeds = str: lib.lists.foldr (lib.strings.removeSuffix) str ["\r" "\n"];
111 in removeLineFeeds file;
114 smoke-test = nixosTests.bcachefs;
118 enableParallelBuilding = true;
120 description = "Userspace tools for bcachefs";
121 homepage = http://bcachefs.org;
122 license = licenses.gpl2;
123 platforms = platforms.linux;
125 [ "Kent Overstreet <kent.overstreet@gmail.com>"