1 { lib, stdenv, fetchFromGitHub, pkg-config, util-linux, bash }:
3 stdenv.mkDerivation rec {
4 pname = "bcache-tools";
7 src = fetchFromGitHub {
11 hash = "sha256-Ors2xXRrVTf8Cq3BYnSVSfJy/nyGjT5BGLSNpxOcHR4=";
14 nativeBuildInputs = [ pkg-config ];
15 buildInputs = [ util-linux ];
17 # * Remove broken install rules (they ignore $PREFIX) for stuff we don't need
18 # anyway (it's distro specific stuff).
19 # * Fixup absolute path to modprobe.
21 sed -e "/INSTALL.*initramfs\/hook/d" \
22 -e "/INSTALL.*initcpio\/install/d" \
23 -e "/INSTALL.*dracut\/module-setup.sh/d" \
24 -e "s/pkg-config/$PKG_CONFIG/" \
29 ./bcache-udev-modern.patch
34 "PREFIX=${placeholder "out"}"
35 "UDEVLIBDIR=${placeholder "out"}/lib/udev/"
39 sed -e "s|/bin/sh|${bash}/bin/sh|" -i *.rules
43 mkdir -p "$out/sbin" "$out/lib/udev/rules.d" "$out/share/man/man8"
47 description = "User-space tools required for bcache (Linux block layer cache)";
49 Bcache is a Linux kernel block layer cache. It allows one or more fast
50 disk drives such as flash-based solid state drives (SSDs) to act as a
51 cache for one or more slower hard disk drives.
53 This package contains the required user-space tools.
55 User documentation is in Documentation/bcache.txt in the Linux kernel
58 homepage = "https://bcache.evilpiepirate.org/";
59 license = licenses.gpl2;
60 platforms = platforms.linux;
61 maintainers = [ maintainers.bjornfor ];