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

authored by

Aleksana and committed by
GitHub
daaa22f5 7cabc47e

+22 -13
+22 -13
pkgs/by-name/da/dae/package.nix
··· 3 clang, 4 fetchFromGitHub, 5 buildGoModule, 6 nixosTests, 7 nix-update-script, 8 }: 9 - buildGoModule rec { 10 pname = "dae"; 11 version = "1.0.0"; 12 13 src = fetchFromGitHub { 14 owner = "daeuniverse"; 15 repo = "dae"; 16 - rev = "v${version}"; 17 hash = "sha256-RpbWZEoGrCq3Py0hu6YDie6ErDTLS3oabqScPzhCtm0="; 18 fetchSubmodules = true; 19 }; ··· 33 34 make CFLAGS="-D__REMOVE_BPF_PRINTK -fno-stack-protector -Wno-unused-command-line-argument" \ 35 NOSTRIP=y \ 36 - VERSION=${version} \ 37 OUTPUT=$out/bin/dae 38 39 runHook postBuild ··· 45 postInstall = '' 46 install -Dm444 install/dae.service $out/lib/systemd/system/dae.service 47 substituteInPlace $out/lib/systemd/system/dae.service \ 48 - --replace /usr/bin/dae $out/bin/dae 49 ''; 50 51 - passthru.tests = { 52 - inherit (nixosTests) dae; 53 }; 54 55 - passthru.updateScript = nix-update-script { }; 56 - 57 - meta = with lib; { 58 description = "Linux high-performance transparent proxy solution based on eBPF"; 59 homepage = "https://github.com/daeuniverse/dae"; 60 - license = licenses.agpl3Only; 61 - maintainers = with maintainers; [ 62 oluceps 63 pokon548 64 luochen1990 65 ]; 66 - platforms = platforms.linux; 67 mainProgram = "dae"; 68 }; 69 - }
··· 3 clang, 4 fetchFromGitHub, 5 buildGoModule, 6 + versionCheckHook, 7 nixosTests, 8 nix-update-script, 9 }: 10 + 11 + buildGoModule (finalAttrs: { 12 pname = "dae"; 13 version = "1.0.0"; 14 15 src = fetchFromGitHub { 16 owner = "daeuniverse"; 17 repo = "dae"; 18 + tag = "v${finalAttrs.version}"; 19 hash = "sha256-RpbWZEoGrCq3Py0hu6YDie6ErDTLS3oabqScPzhCtm0="; 20 fetchSubmodules = true; 21 }; ··· 35 36 make CFLAGS="-D__REMOVE_BPF_PRINTK -fno-stack-protector -Wno-unused-command-line-argument" \ 37 NOSTRIP=y \ 38 + VERSION=${finalAttrs.version} \ 39 OUTPUT=$out/bin/dae 40 41 runHook postBuild ··· 47 postInstall = '' 48 install -Dm444 install/dae.service $out/lib/systemd/system/dae.service 49 substituteInPlace $out/lib/systemd/system/dae.service \ 50 + --replace-fail "/usr/bin/dae" "$out/bin/dae" 51 ''; 52 53 + doInstallCheck = true; 54 + 55 + nativeInstallCheckInputs = [ versionCheckHook ]; 56 + 57 + versionCheckProgramArg = "--version"; 58 + 59 + passthru = { 60 + tests = { 61 + inherit (nixosTests) dae; 62 + }; 63 + updateScript = nix-update-script { }; 64 }; 65 66 + meta = { 67 description = "Linux high-performance transparent proxy solution based on eBPF"; 68 homepage = "https://github.com/daeuniverse/dae"; 69 + license = lib.licenses.agpl3Only; 70 + maintainers = with lib.maintainers; [ 71 oluceps 72 pokon548 73 luochen1990 74 ]; 75 + platforms = lib.platforms.linux; 76 mainProgram = "dae"; 77 }; 78 + })