2024-06-16 17:13:18 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
clang,
|
|
|
|
fetchFromGitHub,
|
|
|
|
buildGoModule,
|
2024-08-17 22:29:43 +00:00
|
|
|
nixosTests,
|
2023-03-27 12:37:26 +00:00
|
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "dae";
|
2024-08-21 07:38:02 +00:00
|
|
|
version = "0.7.1";
|
2023-03-27 12:37:26 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "daeuniverse";
|
2023-08-02 14:40:40 +00:00
|
|
|
repo = "dae";
|
2023-03-27 12:37:26 +00:00
|
|
|
rev = "v${version}";
|
2024-08-21 07:38:02 +00:00
|
|
|
hash = "sha256-A82JwjZTzYvRc0PY2FekRUwLszdCEHv6wcLYHvqwiWU=";
|
2023-03-27 12:37:26 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2024-08-21 07:38:02 +00:00
|
|
|
vendorHash = "sha256-PCGv1DcOOP2LE5wGmnuB2t3aJP8nqJ/ChafVxeJnRIg=";
|
2023-03-27 12:37:26 +00:00
|
|
|
|
|
|
|
proxyVendor = true;
|
|
|
|
|
2024-01-18 09:45:46 +00:00
|
|
|
nativeBuildInputs = [ clang ];
|
2023-03-27 12:37:26 +00:00
|
|
|
|
2024-07-09 02:27:36 +00:00
|
|
|
hardeningDisable = [
|
|
|
|
"zerocallusedregs"
|
|
|
|
];
|
|
|
|
|
2024-06-16 17:13:18 +00:00
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
2023-03-27 12:37:26 +00:00
|
|
|
|
2023-09-02 16:18:34 +00:00
|
|
|
make CFLAGS="-D__REMOVE_BPF_PRINTK -fno-stack-protector -Wno-unused-command-line-argument" \
|
2023-03-27 12:37:26 +00:00
|
|
|
NOSTRIP=y \
|
2024-06-16 17:13:18 +00:00
|
|
|
VERSION=${version} \
|
|
|
|
OUTPUT=$out/bin/dae
|
|
|
|
|
|
|
|
runHook postBuild
|
2023-03-27 12:37:26 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# network required
|
|
|
|
doCheck = false;
|
|
|
|
|
2023-07-18 07:44:29 +00: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
|
|
|
|
'';
|
|
|
|
|
2024-08-17 22:29:43 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) dae;
|
|
|
|
};
|
|
|
|
|
2023-03-27 12:37:26 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Linux high-performance transparent proxy solution based on eBPF";
|
|
|
|
homepage = "https://github.com/daeuniverse/dae";
|
|
|
|
license = licenses.agpl3Only;
|
2024-06-16 17:13:18 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
oluceps
|
|
|
|
pokon548
|
|
|
|
];
|
2023-03-27 12:37:26 +00:00
|
|
|
platforms = platforms.linux;
|
2023-08-07 06:33:33 +00:00
|
|
|
mainProgram = "dae";
|
2023-03-27 12:37:26 +00:00
|
|
|
};
|
|
|
|
}
|