nixpkgs/pkgs/os-specific/linux/below/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.1 KiB
Nix
Raw Normal View History

2022-12-14 20:44:22 +00:00
{ lib
, fetchFromGitHub
, rustPlatform
, clang
, 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
hardeningDisable = [ "stackprotector" "zerocallusedregs" ];
2022-12-14 20:44:22 +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";
mainProgram = "below";
2022-12-14 20:44:22 +00:00
};
}