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