ebpf-sandbox/tcpfilter/default.nix
2024-12-24 21:34:28 +01:00

16 lines
352 B
Nix

{clangStdenv, libbpf, ...}: clangStdenv.mkDerivation {
name = "tcpfilter";
src = ./.;
hardeningDisable = [ "stackprotector" "zerocallusedregs" ];
dontFixup = true;
buildInputs = [ libbpf ];
buildPhase = ''
clang -O2 -target bpf -g -c tcpfilter.c -o tcpfilter.o
'';
installPhase = ''
mkdir $out
cp tcpfilter.o $out
'';
}