Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 23.11 58 lines 1.3 kB view raw
1{ lib 2, fetchCrate 3, rustPlatform 4, pkg-config 5, installShellFiles 6, openssl 7, dbus 8, sqlite 9, stdenv 10, darwin 11, testers 12, leetcode-cli 13}: 14 15rustPlatform.buildRustPackage rec { 16 pname = "leetcode-cli"; 17 version = "0.4.2"; 18 19 src = fetchCrate { 20 inherit pname version; 21 sha256 = "sha256-Yr8Jsy8863O6saaFRAxssni+PtK7XYe+Iifgxu8Rx6Q="; 22 }; 23 24 cargoHash = "sha256-rab/oLr27UOlnwUUB1RXC/egLoYyzmVtzN1L+AGed8o="; 25 26 nativeBuildInputs = [ 27 pkg-config 28 installShellFiles 29 ]; 30 31 buildInputs = [ 32 openssl 33 dbus 34 sqlite 35 ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ]; 36 37 postInstall = '' 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) 42 ''; 43 44 passthru.tests = testers.testVersion { 45 package = leetcode-cli; 46 command = "leetcode -V"; 47 version = "leetcode ${version}"; 48 }; 49 50 meta = with lib; { 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"; 57 }; 58}