25 , versionString ? lastModified
30 , testWithValgrind ? true
36 assert fuseSupport -> fuse3 != null;
37 assert testWithValgrind -> valgrind != null;
39 pname = "bcachefs-tools";
41 version = "v0.1-flake-${versionString}";
42 VERSION = "v0.1-flake-${versionString}";
45 name = "bcachefs-tools";
58 postPatch = "patchShebangs --build doc/macro2rst.py";
61 # used to find dependencies
66 # bcachefs explicit dependencies
71 keyutils # libkeyutils
82 # unspecified dependencies
86 # documentation depenedencies
88 python39Packages.pygments
89 ] ++ (lib.optional fuseSupport fuse3)
90 ++ (lib.optional testWithValgrind valgrind) ;
93 "PREFIX=${placeholder "out"}"
94 ] ++ lib.optional debugMode "EXTRA_CFLAGS=-ggdb";
97 "INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools"
100 doCheck = true; # needs bcachefs module loaded on builder
103 python39Packages.pytest
104 python39Packages.pytest-xdist
105 ] ++ lib.optional testWithValgrind valgrind;
108 "BCACHEFS_TEST_USE_VALGRIND=${if testWithValgrind then "yes" else "no"}"
109 # cannot escape spaces within make flags, quotes are stripped
110 "PYTEST_CMD=pytest" # "PYTEST_ARGS='-n4 --version'"
115 makeFlagsArray+=(PYTEST_ARGS="--verbose -n2")
117 lib.optionalString fuseSupport ''
118 rm tests/test_fuse.py
121 dontStrip = debugMode == true;
123 bcachefs_revision = let
124 file = builtins.readFile ./.bcachefs_revision;
125 removeLineFeeds = str: lib.lists.foldr (lib.strings.removeSuffix) str ["\r" "\n"];
126 in removeLineFeeds file;
129 smoke-test = nixosTests.bcachefs;
133 enableParallelBuilding = true;
135 description = "Userspace tools for bcachefs";
136 homepage = http://bcachefs.org;
137 license = licenses.gpl2;
138 platforms = platforms.linux;
140 [ "Kent Overstreet <kent.overstreet@gmail.com>"