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 longDescription = ''
41 Chit helps answer these questions:
42
43 * Who wrote this crate? What else did they write?
44 * What alternatives are there?
45 * How old is this crate?
46 * What versions are there? When did they come out?
47 * What are the downloads over time?
48 * Should i use this crate?
49 * How mature is it?
50 '';
51 homepage = "https://github.com/peterheesterman/chit";
52 license = licenses.mit;
53 maintainers = with maintainers; [ figsoda lilyball ];
54 };
55}