1{ lib
2, rustPlatform
3, fetchFromGitHub
4, pkg-config
5, stdenv
6, openssl
7, darwin
8}:
9
10rustPlatform.buildRustPackage rec {
11 pname = "chit";
12 version = "0.1.15";
13
14 src = fetchFromGitHub {
15 owner = "peterheesterman";
16 repo = pname;
17 rev = version;
18 sha256 = "0iixczy3cad44j2d7zzj8f3lnmp4jwnb0snmwfgiq3vj9wrn28pz";
19 };
20
21 cargoLock = {
22 lockFile = ./Cargo.lock;
23 };
24
25 nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config ];
26
27 buildInputs = lib.optionals stdenv.isLinux [
28 openssl
29 ] ++ lib.optionals stdenv.isDarwin [
30 darwin.apple_sdk.frameworks.Security
31 ];
32
33 # update Carg.lock to work with openssl 3
34 postPatch = ''
35 ln -sf ${./Cargo.lock} Cargo.lock
36 '';
37
38 meta = with lib; {
39 description = "Crate help in terminal: A tool for looking up details about rust crates without going to crates.io";
40 mainProgram = "chit";
41 longDescription = ''
42 Chit helps answer these questions:
43
44 * Who wrote this crate? What else did they write?
45 * What alternatives are there?
46 * How old is this crate?
47 * What versions are there? When did they come out?
48 * What are the downloads over time?
49 * Should i use this crate?
50 * How mature is it?
51 '';
52 homepage = "https://github.com/peterheesterman/chit";
53 license = licenses.mit;
54 maintainers = with maintainers; [ figsoda ];
55 };
56}