From e1c421af54b5f11d56663d6e700ee0c2b8578f93 Mon Sep 17 00:00:00 2001 From: imxyy_soope_ Date: Wed, 22 Jul 2026 17:00:12 +0800 Subject: [PATCH] pkgs: dae: init --- pkgs/dae.nix | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 pkgs/dae.nix diff --git a/pkgs/dae.nix b/pkgs/dae.nix new file mode 100644 index 0000000..4b4b620 --- /dev/null +++ b/pkgs/dae.nix @@ -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"; + }; +})