diff --git a/pkgs/development/tools/detekt/default.nix b/pkgs/development/tools/detekt/default.nix index 75ac8e45e4ae..45ef24e4b1f7 100644 --- a/pkgs/development/tools/detekt/default.nix +++ b/pkgs/development/tools/detekt/default.nix @@ -1,12 +1,12 @@ -{ detekt, lib, stdenv, fetchurl, makeWrapper, jre_headless, testers }: -stdenv.mkDerivation rec { +{ lib, stdenv, fetchurl, makeWrapper, jre_headless, testers }: +stdenv.mkDerivation (finalAttrs: { pname = "detekt"; version = "1.23.7"; - jarfilename = "${pname}-${version}-executable.jar"; + jarfilename = "detekt-${finalAttrs.version}-executable.jar"; src = fetchurl { - url = "https://github.com/detekt/detekt/releases/download/v${version}/detekt-cli-${version}-all.jar"; + url = "https://github.com/detekt/detekt/releases/download/v${finalAttrs.version}/detekt-cli-${finalAttrs.version}-all.jar"; sha256 = "sha256-hL7e0oMBLLKzi8rvSZZFL81gadLpynS1Dqp54K0hiX4="; }; @@ -17,15 +17,15 @@ stdenv.mkDerivation rec { installPhase = '' runHook preInstall - install -D "$src" "$out/share/java/${jarfilename}" + install -D "$src" "$out/share/java/${finalAttrs.jarfilename}" makeWrapper ${jre_headless}/bin/java $out/bin/detekt \ - --add-flags "-jar $out/share/java/${jarfilename}" + --add-flags "-jar $out/share/java/${finalAttrs.jarfilename}" runHook postInstall ''; - passthru.tests.version = testers.testVersion { package = detekt; }; + passthru.tests.version = testers.testVersion { package = finalAttrs.finalPackage; }; meta = with lib; { description = "Static code analysis for Kotlin"; @@ -36,4 +36,4 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ mdr ]; sourceProvenance = with sourceTypes; [ binaryBytecode ]; }; -} +})