blob: 0253fd796cb3f92bf8542addfc5f14ef9c2d75dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
{ lib
, stdenvNoCC
, callPackage
, nixosTests
, autoPatchelfHook
, binary
, mount
, versionString ? "0.1"
}:
stdenvNoCC.mkDerivation {
pname = "bcachefs-tools";
version = "v0.1-flake-${versionString}";
nativeBuildInputs = [
binary
mount
];
buildInputs = mount.propagatedBuildInputs;
phases = [ "installPhase" ];
installPhase = ''
mkdir $out
mkdir $out/bin
mkdir $out/lib
mkdir $out/share
mkdir $out/etc
cp -pr "${binary}/bin/"* $out/bin
cp -pr "${binary}/lib/"* $out/lib
cp -pr "${binary}/share/"* $out/share
cp -pr "${binary}/etc/"* $out/etc
cp -pr "${mount}/bin/"* $out/bin/
chmod u+w $out/bin/*
patchelf --add-rpath $out/lib $out/bin/bcachefs-mount
ln -s "$out/bin/bcachefs-mount" "$out/bin/mount.bcachefs"
ln -s "$out/bin" "$out/sbin"
'';
passthru = {
tests = {
smoke-test = nixosTests.bcachefs;
};
};
enableParallelBuilding = true;
meta = with lib; {
description = "Userspace tools for bcachefs";
homepage = http://bcachefs.org;
license = licenses.gpl2;
platforms = platforms.linux;
maintainers =
[ "Kent Overstreet <kent.overstreet@gmail.com>"
];
};
}
|