2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, clang
|
|
|
|
, pkg-config
|
|
|
|
, elfutils
|
|
|
|
, rustfmt
|
|
|
|
, zlib
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "below";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.7.1";
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebookincubator";
|
|
|
|
repo = "below";
|
|
|
|
rev = "v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
sha256 = "sha256-2mZBpvLPY6yrEAvB1YlFuaXJlmmNuZqhu3xWADNHbx0=";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
cargoHash = "sha256-cTNxWCd4YH5VuZh0GRfBNtHmLqCQ75uyHqROkv1jbRA=";
|
2022-12-17 10:02:37 +00:00
|
|
|
|
2023-07-15 17:15:38 +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-17 10:02:37 +00:00
|
|
|
# bpf code compilation
|
|
|
|
hardeningDisable = [ "stackprotector" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ clang pkg-config rustfmt ];
|
|
|
|
buildInputs = [ elfutils zlib ];
|
|
|
|
|
|
|
|
# needs /sys/fs/cgroup
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ globin ];
|
|
|
|
description = "A time traveling resource monitor for modern Linux systems";
|
|
|
|
license = licenses.asl20;
|
|
|
|
homepage = "https://github.com/facebookincubator/below";
|
2023-08-04 22:07:22 +00:00
|
|
|
mainProgram = "below";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
}
|