2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, rustPlatform, fetchFromGitHub, pkgconfig, makeWrapper, openssl, curl
|
2020-04-24 23:36:52 +00:00
|
|
|
, nix, Security
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "nix-index";
|
|
|
|
version = "0.1.2";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bennofs";
|
|
|
|
repo = "nix-index";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "05fqfwz34n4ijw7ydw2n6bh4bv64rhks85cn720sy5r7bmhfmfa8";
|
|
|
|
};
|
|
|
|
|
|
|
|
cargoSha256 = "0apdr9z18p6m4lfjv8k9zv2mqc7vssd2d536zfv1pns0pdqsfw50";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig makeWrapper ];
|
|
|
|
buildInputs = [ openssl curl ]
|
2021-01-15 22:18:51 +00:00
|
|
|
++ lib.optional stdenv.isDarwin Security;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/etc/profile.d
|
|
|
|
cp ./command-not-found.sh $out/etc/profile.d/command-not-found.sh
|
|
|
|
substituteInPlace $out/etc/profile.d/command-not-found.sh \
|
|
|
|
--replace "@out@" "$out"
|
|
|
|
wrapProgram $out/bin/nix-index \
|
2021-01-15 22:18:51 +00:00
|
|
|
--prefix PATH : "${lib.makeBinPath [ nix ]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A files database for nixpkgs";
|
|
|
|
homepage = "https://github.com/bennofs/nix-index";
|
|
|
|
license = with licenses; [ bsd3 ];
|
|
|
|
maintainers = [ maintainers.bennofs ];
|
|
|
|
};
|
|
|
|
}
|