2022-12-14 20:44:22 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, clang
|
2022-12-15 12:07:41 +00:00
|
|
|
, pkg-config
|
2022-12-14 20:44:22 +00:00
|
|
|
, elfutils
|
|
|
|
, rustfmt
|
|
|
|
, zlib
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "below";
|
2024-04-29 03:27:31 +00:00
|
|
|
version = "0.8.1";
|
2022-12-14 20:44:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebookincubator";
|
|
|
|
repo = "below";
|
|
|
|
rev = "v${version}";
|
2024-04-29 03:27:31 +00:00
|
|
|
sha256 = "sha256-87Fdx3Jqi3dNWM5DZl+UYs031qn2DoiiWd3IysT/glQ=";
|
2022-12-14 20:44:22 +00:00
|
|
|
};
|
|
|
|
|
2024-04-29 03:27:31 +00:00
|
|
|
cargoHash = "sha256-y2fNypA0MrCdUI/K6QrZWw/5mkYafj2s6jrGHU2zGXw=";
|
2022-12-14 20:44:22 +00:00
|
|
|
|
2023-05-26 15:37:03 +00:00
|
|
|
prePatch = ''sed -i "s,ExecStart=.*/bin,ExecStart=$out/bin," etc/below.service'';
|
|
|
|
postInstall = ''
|
|
|
|
install -d $out/lib/systemd/system
|
|
|
|
install -t $out/lib/systemd/system etc/below.service
|
|
|
|
'';
|
|
|
|
|
2022-12-14 20:44:22 +00:00
|
|
|
# bpf code compilation
|
2024-07-07 09:18:40 +00:00
|
|
|
hardeningDisable = [ "stackprotector" "zerocallusedregs" ];
|
2022-12-14 20:44:22 +00:00
|
|
|
|
2022-12-15 12:07:41 +00:00
|
|
|
nativeBuildInputs = [ clang pkg-config rustfmt ];
|
2022-12-14 20:44:22 +00:00
|
|
|
buildInputs = [ elfutils zlib ];
|
|
|
|
|
|
|
|
# needs /sys/fs/cgroup
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ globin ];
|
|
|
|
description = "Time traveling resource monitor for modern Linux systems";
|
|
|
|
license = licenses.asl20;
|
|
|
|
homepage = "https://github.com/facebookincubator/below";
|
2023-07-31 19:21:43 +00:00
|
|
|
mainProgram = "below";
|
2022-12-14 20:44:22 +00:00
|
|
|
};
|
|
|
|
}
|