From d244ad11574bf43f80165bd51ad740574adf2cb5 Mon Sep 17 00:00:00 2001 From: Yiyu Zhou Date: Mon, 23 Feb 2026 19:34:46 -0800 Subject: [PATCH] leetcode-cli: cleanup --- pkgs/by-name/le/leetcode-cli/package.nix | 35 ++++++++++++------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/pkgs/by-name/le/leetcode-cli/package.nix b/pkgs/by-name/le/leetcode-cli/package.nix index 430a1412dc38..0e111b922c04 100644 --- a/pkgs/by-name/le/leetcode-cli/package.nix +++ b/pkgs/by-name/le/leetcode-cli/package.nix @@ -1,36 +1,36 @@ { - lib, - fetchCrate, - rustPlatform, - pkg-config, - installShellFiles, - openssl, dbus, + fetchCrate, + installShellFiles, + lib, + nix-update-script, + openssl, + pkg-config, + rustPlatform, sqlite, stdenv, - testers, - leetcode-cli, + versionCheckHook, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "leetcode-cli"; version = "0.5.0"; src = fetchCrate { - inherit pname version; + inherit (finalAttrs) pname version; hash = "sha256-EafEz5MhY9f56N1LCPaW+ktYrV01r9vHCbublDnfAKg="; }; cargoHash = "sha256-8bHpNckEsJ4VWlmEaDTeMW+Txi9SQh30lK5CKKperC8="; nativeBuildInputs = [ - pkg-config installShellFiles + pkg-config ]; buildInputs = [ - openssl dbus + openssl sqlite ]; @@ -41,11 +41,10 @@ rustPlatform.buildRustPackage rec { --zsh <($out/bin/leetcode completions zsh) ''; - passthru.tests = testers.testVersion { - package = leetcode-cli; - command = "leetcode -V"; - version = "leetcode ${version}"; - }; + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + + passthru.updateScript = nix-update-script { }; meta = { description = "Leetcode CLI utility"; @@ -54,4 +53,4 @@ rustPlatform.buildRustPackage rec { maintainers = with lib.maintainers; [ congee ]; mainProgram = "leetcode"; }; -} +})