2018-12-04 00:54:37 +00:00
|
|
|
{ stdenv, rustPlatform, fetchFromGitHub, pkgconfig, makeWrapper, openssl, curl
|
|
|
|
, nix, Security
|
2018-10-12 18:04:19 +01:00
|
|
|
}:
|
2017-07-23 22:09:54 +01:00
|
|
|
|
2018-10-12 18:04:19 +01:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-08-31 12:41:23 +01:00
|
|
|
pname = "nix-index";
|
2018-10-11 20:42:28 +01:00
|
|
|
version = "0.1.2";
|
2017-07-23 22:09:54 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bennofs";
|
|
|
|
repo = "nix-index";
|
|
|
|
rev = "v${version}";
|
2018-10-11 20:42:28 +01:00
|
|
|
sha256 = "05fqfwz34n4ijw7ydw2n6bh4bv64rhks85cn720sy5r7bmhfmfa8";
|
2017-07-23 22:09:54 +01:00
|
|
|
};
|
2020-02-14 02:00:26 +00:00
|
|
|
# Delete this on next update; see #79975 for details
|
|
|
|
legacyCargoFetcher = true;
|
|
|
|
|
2019-12-20 20:08:53 +00:00
|
|
|
cargoSha256 = "06idjb5h5fahqklyxnss2zffrvvfbcw0hjh1mcrf1872s4x78ags";
|
2018-12-04 00:54:37 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig makeWrapper ];
|
2018-10-12 18:04:19 +01:00
|
|
|
buildInputs = [ openssl curl ]
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin Security;
|
2017-07-23 22:09:54 +01:00
|
|
|
|
2018-11-03 20:54:02 +00:00
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
2017-07-23 22:09:54 +01:00
|
|
|
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"
|
2018-12-04 00:54:37 +00:00
|
|
|
wrapProgram $out/bin/nix-index \
|
|
|
|
--prefix PATH : "${stdenv.lib.makeBinPath [ nix ]}"
|
2017-07-23 22:09:54 +01:00
|
|
|
'';
|
|
|
|
|
2018-10-12 18:04:19 +01:00
|
|
|
meta = with stdenv.lib; {
|
2017-07-23 22:09:54 +01:00
|
|
|
description = "A files database for nixpkgs";
|
|
|
|
homepage = https://github.com/bennofs/nix-index;
|
|
|
|
license = with licenses; [ bsd3 ];
|
|
|
|
maintainers = [ maintainers.bennofs ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|