1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 pkg-config,
6 openssl,
7 curl,
8 sqlite,
9}:
10
11rustPlatform.buildRustPackage rec {
12 pname = "nix-index";
13 version = "0.1.9";
14
15 src = fetchFromGitHub {
16 owner = "nix-community";
17 repo = "nix-index";
18 rev = "v${version}";
19 hash = "sha256-kOVmgST/D3zNOcGVu1ReuPuVrUx41iRK4rs59lqYX74=";
20 };
21
22 cargoHash = "sha256-0yrTPrxN/4TOALqpQ5GW7LXKisc8msx3DvEpg8uO+IQ=";
23
24 nativeBuildInputs = [ pkg-config ];
25 buildInputs = [
26 openssl
27 curl
28 sqlite
29 ];
30
31 postInstall = ''
32 substituteInPlace command-not-found.sh \
33 --subst-var out
34 install -Dm555 command-not-found.sh -t $out/etc/profile.d
35 substituteInPlace command-not-found.nu \
36 --subst-var out
37 install -Dm555 command-not-found.nu -t $out/etc/profile.d
38 '';
39
40 meta = with lib; {
41 description = "Files database for nixpkgs";
42 homepage = "https://github.com/nix-community/nix-index";
43 changelog = "https://github.com/nix-community/nix-index/blob/${src.rev}/CHANGELOG.md";
44 license = with licenses; [ bsd3 ];
45 maintainers = with maintainers; [
46 bennofs
47 figsoda
48 ncfavier
49 ];
50 };
51}