oxlint: switch to finalAttrs (#430878)

authored by Yohann Boniface and committed by GitHub 98630c12 2a23638b

+14 -6
+14 -6
pkgs/by-name/ox/oxlint/package.nix
··· 2 2 lib, 3 3 rustPlatform, 4 4 fetchFromGitHub, 5 + nix-update-script, 5 6 rust-jemalloc-sys, 7 + versionCheckHook, 6 8 }: 7 9 8 - rustPlatform.buildRustPackage rec { 10 + rustPlatform.buildRustPackage (finalAttrs: { 9 11 pname = "oxlint"; 10 12 version = "1.6.0"; 11 13 12 14 src = fetchFromGitHub { 13 15 owner = "oxc-project"; 14 16 repo = "oxc"; 15 - tag = "oxlint_v${version}"; 17 + tag = "oxlint_v${finalAttrs.version}"; 16 18 hash = "sha256-URgz9k89WgYfCu9OlNCZk5wRt8upt58rIxFWa90L+OQ="; 17 19 }; 18 20 ··· 22 24 rust-jemalloc-sys 23 25 ]; 24 26 25 - env.OXC_VERSION = version; 27 + env.OXC_VERSION = finalAttrs.version; 26 28 27 29 cargoBuildFlags = [ 28 30 "--bin=oxlint" 29 31 "--bin=oxc_language_server" 30 32 ]; 31 - cargoTestFlags = cargoBuildFlags; 33 + cargoTestFlags = finalAttrs.cargoBuildFlags; 34 + 35 + nativeInstallCheckInputs = [ versionCheckHook ]; 36 + versionCheckProgramArg = "--version"; 37 + doInstallCheck = true; 38 + 39 + passthru.updateScript = nix-update-script { }; 32 40 33 41 meta = { 34 42 description = "Collection of JavaScript tools written in Rust"; 35 43 homepage = "https://github.com/oxc-project/oxc"; 36 - changelog = "https://github.com/oxc-project/oxc/releases/tag/${src.tag}"; 44 + changelog = "https://github.com/oxc-project/oxc/releases/tag/${finalAttrs.src.tag}"; 37 45 license = lib.licenses.mit; 38 46 maintainers = with lib.maintainers; [ figsoda ]; 39 47 mainProgram = "oxlint"; 40 48 }; 41 - } 49 + })