13 stdenv.mkDerivation rec {
15 version = "0-unstable-2024-06-07";
17 src = fetchFromGitHub {
20 rev = "04bab5dd306b55b3e4e13e261af2480b7ccff9fc";
21 hash = "sha256-kVjvupZ6HxJocwXWOrxUNqEGl0welJRlZwvOmMKqeBA=";
25 # otherwise shrink rpath would drop $out/lib from rpath
26 substituteInPlace src/Makefile \
27 --replace-fail /lib64 /lib \
28 --replace-fail /sbin /bin \
29 --replace-fail ldconfig true
30 substituteInPlace src/bpftune.service \
31 --replace-fail /usr/sbin/bpftune "$out/bin/bpftune"
32 substituteInPlace include/bpftune/libbpftune.h \
33 --replace-fail /usr/lib64/bpftune/ "$out/lib/bpftune/" \
34 --replace-fail /usr/local/lib64/bpftune/ "$out/lib/bpftune/"
35 substituteInPlace src/libbpftune.c \
36 --replace-fail /lib/modules /run/booted-system/kernel-modules/lib/modules
52 "prefix=${placeholder "out"}"
53 "confprefix=${placeholder "out"}/etc"
54 "BPFTUNE_VERSION=${version}"
55 "NL_INCLUDE=${lib.getDev libnl}/include/libnl3"
56 "BPF_INCLUDE=${lib.getDev libbpf}/include"
65 inherit (nixosTests) bpftune;
68 enableParallelBuilding = true;
71 description = "BPF-based auto-tuning of Linux system parameters";
72 mainProgram = "bpftune";
73 homepage = "https://github.com/oracle-samples/bpftune";
74 license = licenses.gpl2Only;
75 maintainers = with maintainers; [ nickcao ];