15 rustPlatform.buildRustPackage rec {
16 pname = "leetcode-cli";
20 inherit pname version;
21 hash = "sha256-Jc0akHj2DHbkF7sjslOwdeI1piW2gnhoalBz18lpQdQ=";
24 cargoHash = "sha256-t3u82bjO1Qv32TwpZNCaaEqOVajXIgM7VBNQ4UjMcl8=";
35 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.Security ];
37 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
38 installShellCompletion --cmd leetcode \
39 --bash <($out/bin/leetcode completions bash) \
40 --fish <($out/bin/leetcode completions fish) \
41 --zsh <($out/bin/leetcode completions zsh)
44 passthru.tests = testers.testVersion {
45 package = leetcode-cli;
46 command = "leetcode -V";
47 version = "leetcode ${version}";
51 description = "May the code be with you 👻";
52 longDescription = "Use leetcode.com in command line";
53 homepage = "https://github.com/clearloop/leetcode-cli";
54 license = licenses.mit;
55 maintainers = with maintainers; [ congee ];
56 mainProgram = "leetcode";