dae: use finalAttrs and remove with lib (#428798)

This commit is contained in:
Aleksana
2025-07-27 17:36:02 +08:00
committed by GitHub
+22 -13
View File
@@ -3,17 +3,19 @@
clang,
fetchFromGitHub,
buildGoModule,
versionCheckHook,
nixosTests,
nix-update-script,
}:
buildGoModule rec {
buildGoModule (finalAttrs: {
pname = "dae";
version = "1.0.0";
src = fetchFromGitHub {
owner = "daeuniverse";
repo = "dae";
rev = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-RpbWZEoGrCq3Py0hu6YDie6ErDTLS3oabqScPzhCtm0=";
fetchSubmodules = true;
};
@@ -33,7 +35,7 @@ buildGoModule rec {
make CFLAGS="-D__REMOVE_BPF_PRINTK -fno-stack-protector -Wno-unused-command-line-argument" \
NOSTRIP=y \
VERSION=${version} \
VERSION=${finalAttrs.version} \
OUTPUT=$out/bin/dae
runHook postBuild
@@ -45,25 +47,32 @@ buildGoModule rec {
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
--replace-fail "/usr/bin/dae" "$out/bin/dae"
'';
passthru.tests = {
inherit (nixosTests) dae;
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
passthru = {
tests = {
inherit (nixosTests) dae;
};
updateScript = nix-update-script { };
};
passthru.updateScript = nix-update-script { };
meta = with lib; {
meta = {
description = "Linux high-performance transparent proxy solution based on eBPF";
homepage = "https://github.com/daeuniverse/dae";
license = licenses.agpl3Only;
maintainers = with maintainers; [
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [
oluceps
pokon548
luochen1990
];
platforms = platforms.linux;
platforms = lib.platforms.linux;
mainProgram = "dae";
};
}
})