2023-03-27 14:37:26 +02:00
|
|
|
{ lib
|
|
|
|
, clang
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildGoModule
|
|
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "dae";
|
2023-09-02 18:18:34 +02:00
|
|
|
version = "0.3.0";
|
2023-03-27 14:37:26 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "daeuniverse";
|
2023-08-02 16:40:40 +02:00
|
|
|
repo = "dae";
|
2023-03-27 14:37:26 +02:00
|
|
|
rev = "v${version}";
|
2023-09-02 18:18:34 +02:00
|
|
|
hash = "sha256-WiJqhXYehuUCLEuVbsQkmTntuH1srtePtZgYBSTbxiw=";
|
2023-03-27 14:37:26 +02:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2023-09-02 18:18:34 +02:00
|
|
|
vendorHash = "sha256-fb4PEMhV8+5zaRJyl+nYi2BHcOUDUVAwxce2xaRt5JA=";
|
2023-03-27 14:37:26 +02:00
|
|
|
|
|
|
|
proxyVendor = true;
|
|
|
|
|
2023-09-02 18:18:34 +02:00
|
|
|
nativeBuildInputs = [ clang ];
|
2023-03-27 14:37:26 +02:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/daeuniverse/dae/cmd.Version=${version}"
|
|
|
|
"-X github.com/daeuniverse/dae/common/consts.MaxMatchSetLen_=64"
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
2023-09-02 18:18:34 +02:00
|
|
|
make CFLAGS="-D__REMOVE_BPF_PRINTK -fno-stack-protector -Wno-unused-command-line-argument" \
|
2023-03-27 14:37:26 +02:00
|
|
|
NOSTRIP=y \
|
|
|
|
ebpf
|
|
|
|
'';
|
|
|
|
|
|
|
|
# network required
|
|
|
|
doCheck = false;
|
|
|
|
|
2023-07-18 09:44:29 +02:00
|
|
|
postInstall = ''
|
|
|
|
install -Dm444 install/dae.service $out/lib/systemd/system/dae.service
|
|
|
|
substituteInPlace $out/lib/systemd/system/dae.service \
|
|
|
|
--replace /usr/bin/dae $out/bin/dae
|
|
|
|
'';
|
|
|
|
|
2023-03-27 14:37:26 +02:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A Linux high-performance transparent proxy solution based on eBPF";
|
|
|
|
homepage = "https://github.com/daeuniverse/dae";
|
|
|
|
license = licenses.agpl3Only;
|
2023-08-07 08:33:33 +02:00
|
|
|
maintainers = with maintainers; [ oluceps pokon548 ];
|
2023-03-27 14:37:26 +02:00
|
|
|
platforms = platforms.linux;
|
2023-08-07 08:33:33 +02:00
|
|
|
mainProgram = "dae";
|
2023-03-27 14:37:26 +02:00
|
|
|
};
|
|
|
|
}
|