24 , versionString ? lastModified
29 , testWithValgrind ? true
35 assert fuseSupport -> fuse3 != null;
36 assert testWithValgrind -> valgrind != null;
38 pname = "bcachefs-tools";
40 version = "v0.1-flake-${versionString}";
41 VERSION = "v0.1-flake-${versionString}";
44 name = "bcachefs-tools";
57 postPatch = "patchShebangs --build doc/macro2rst.py";
60 # used to find dependencies
65 # bcachefs explicit dependencies
70 keyutils # libkeyutils
80 # unspecified dependencies
84 # documentation depenedencies
86 python39Packages.pygments
87 ] ++ (lib.optional fuseSupport fuse3)
88 ++ (lib.optional testWithValgrind valgrind) ;
91 "PREFIX=${placeholder "out"}"
92 ] ++ lib.optional debugMode "EXTRA_CFLAGS=-ggdb";
95 "INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools"
98 doCheck = true; # needs bcachefs module loaded on builder
101 python39Packages.pytest
102 python39Packages.pytest-xdist
103 ] ++ lib.optional testWithValgrind valgrind;
106 "BCACHEFS_TEST_USE_VALGRIND=${if testWithValgrind then "yes" else "no"}"
107 # cannot escape spaces within make flags, quotes are stripped
108 "PYTEST_CMD=pytest" # "PYTEST_ARGS='-n4 --version'"
113 makeFlagsArray+=(PYTEST_ARGS="--verbose -n2")
115 lib.optionalString fuseSupport ''
116 rm tests/test_fuse.py
119 dontStrip = debugMode == true;
121 bcachefs_revision = let
122 file = builtins.readFile ./.bcachefs_revision;
123 removeLineFeeds = str: lib.lists.foldr (lib.strings.removeSuffix) str ["\r" "\n"];
124 in removeLineFeeds file;
127 smoke-test = nixosTests.bcachefs;
131 enableParallelBuilding = true;
133 description = "Userspace tools for bcachefs";
134 homepage = http://bcachefs.org;
135 license = licenses.gpl2;
136 platforms = platforms.linux;
138 [ "Kent Overstreet <kent.overstreet@gmail.com>"