pkgs: dae: init

This commit is contained in:
2026-07-22 18:01:43 +08:00
parent 3fe5b96d00
commit e1c421af54
+58
View File
@@ -0,0 +1,58 @@
# Vendored from nixpkgs
{
lib,
clang,
fetchFromGitHub,
buildGoModule,
}:
buildGoModule (finalAttrs: {
pname = "dae";
version = "1.0.0";
src = fetchFromGitHub {
owner = "daeuniverse";
repo = "dae";
tag = "v${finalAttrs.version}";
hash = "sha256-RpbWZEoGrCq3Py0hu6YDie6ErDTLS3oabqScPzhCtm0=";
fetchSubmodules = true;
};
vendorHash = "sha256-u2DCHmX7vRNWIQ2Ir3UrxPGduggEqoUr1rnkDfwsT0I=";
proxyVendor = true;
nativeBuildInputs = [ clang ];
hardeningDisable = [
"zerocallusedregs"
];
buildPhase = ''
runHook preBuild
make CFLAGS="-D__REMOVE_BPF_PRINTK -fno-stack-protector -Wno-unused-command-line-argument" \
NOSTRIP=y \
VERSION=${finalAttrs.version} \
OUTPUT=$out/bin/dae
runHook postBuild
'';
# network required
doCheck = false;
postInstall = ''
install -Dm444 install/dae.service $out/lib/systemd/system/dae.service
substituteInPlace $out/lib/systemd/system/dae.service \
--replace-fail "/usr/bin/dae" "$out/bin/dae"
'';
meta = {
description = "Linux high-performance transparent proxy solution based on eBPF";
homepage = "https://github.com/daeuniverse/dae";
license = lib.licenses.agpl3Only;
platforms = lib.platforms.linux;
mainProgram = "dae";
};
})