nixpkgs/pkgs/applications/misc/leetcode-cli/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2022-02-09 00:45:07 +01:00
{ lib
, fetchCrate
, rustPlatform
, pkg-config
2023-10-20 01:18:49 +02:00
, installShellFiles
2022-02-09 00:45:07 +01:00
, openssl
, dbus
, sqlite
, stdenv
, darwin
2023-08-14 04:50:34 +02:00
, testers
, leetcode-cli
2022-02-09 00:45:07 +01:00
}:
rustPlatform.buildRustPackage rec {
pname = "leetcode-cli";
2023-12-19 09:11:30 +01:00
version = "0.4.3";
2022-02-09 00:45:07 +01:00
src = fetchCrate {
inherit pname version;
2023-12-19 09:11:30 +01:00
sha256 = "sha256-y5zh93WPWSMDXqYangqrxav+sC0b0zpFIp6ZIew6KMo=";
2022-02-09 00:45:07 +01:00
};
2023-12-19 09:11:30 +01:00
cargoHash = "sha256-VktDiLsU+GOsa6ba9JJZGEPTavSKp+aSZm2dfhPEqMs=";
2022-02-09 00:45:07 +01:00
nativeBuildInputs = [
pkg-config
2023-10-20 01:18:49 +02:00
installShellFiles
2022-02-09 00:45:07 +01:00
];
buildInputs = [
openssl
dbus
sqlite
] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
2023-10-20 01:18:49 +02:00
postInstall = ''
installShellCompletion --cmd leetcode \
--bash <($out/bin/leetcode completions bash) \
--fish <($out/bin/leetcode completions fish) \
--zsh <($out/bin/leetcode completions zsh)
'';
2023-08-14 04:50:54 +02:00
passthru.tests = testers.testVersion {
package = leetcode-cli;
command = "leetcode -V";
version = "leetcode ${version}";
};
2022-02-09 00:45:07 +01:00
meta = with lib; {
description = "May the code be with you 👻";
longDescription = "Use leetcode.com in command line";
homepage = "https://github.com/clearloop/leetcode-cli";
license = licenses.mit;
maintainers = with maintainers; [ congee ];
mainProgram = "leetcode";
};
}