22 , versionString ? "0.1"
27 , testWithValgrind ? true
33 assert fuseSupport -> fuse3 != null;
34 assert testWithValgrind -> valgrind != null;
36 pname = "bcachefs-tools";
38 version = "v0.1-flake-${versionString}";
39 VERSION = "v0.1-flake-${versionString}";
41 src = (lib.cleanSource (builtins.path { name = "bcachefs-tools-src"; path = ./. ;} ));
43 postPatch = "patchShebangs --build doc/macro2rst.py";
46 # used to find dependencies
51 # bcachefs explicit dependencies
56 keyutils # libkeyutils
66 # unspecified dependencies
70 # documentation depenedencies
72 python39Packages.pygments
73 ] ++ (lib.optional fuseSupport fuse3)
74 ++ (lib.optional testWithValgrind valgrind) ;
77 "PREFIX=${placeholder "out"}"
78 ] ++ lib.optional debugMode "EXTRA_CFLAGS=-ggdb";
81 "INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools"
84 doCheck = doCheck; # needs bcachefs module loaded on builder
87 python39Packages.pytest
88 python39Packages.pytest-xdist
89 ] ++ lib.optional testWithValgrind valgrind;
92 "BCACHEFS_TEST_USE_VALGRIND=${if testWithValgrind then "yes" else "no"}"
93 # cannot escape spaces within make flags, quotes are stripped
94 "PYTEST_CMD=pytest" # "PYTEST_ARGS='-n4 --version'"
99 makeFlagsArray+=(PYTEST_ARGS="--verbose -n2")
101 lib.optionalString fuseSupport ''
102 rm tests/test_fuse.py
105 dontStrip = debugMode;
107 bcachefs_revision = let
108 file = builtins.readFile ./.bcachefs_revision;
109 removeLineFeeds = str: lib.lists.foldr (lib.strings.removeSuffix) str ["\r" "\n"];
110 in removeLineFeeds file;
113 smoke-test = nixosTests.bcachefs;
117 enableParallelBuilding = true;
119 description = "Userspace tools for bcachefs";
120 homepage = http://bcachefs.org;
121 license = licenses.gpl2;
122 platforms = platforms.linux;
124 [ "Kent Overstreet <kent.overstreet@gmail.com>"