forked from mirrors/nixpkgs
nix-index: wrap in a separate derivation
This commit is contained in:
parent
a38e53b8d7
commit
f616e094fa
|
@ -1,5 +1,5 @@
|
|||
{ lib, stdenv, rustPlatform, fetchFromGitHub, pkg-config, makeWrapper, openssl, curl
|
||||
, nix, Security
|
||||
{ lib, stdenv, rustPlatform, fetchFromGitHub, pkg-config, openssl, curl
|
||||
, Security
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
|
@ -15,7 +15,7 @@ rustPlatform.buildRustPackage rec {
|
|||
|
||||
cargoSha256 = "161lz96a52s53rhhkxxhcg41bsmh8w6rv6nl8gwqmg3biszy7hah";
|
||||
|
||||
nativeBuildInputs = [ pkg-config makeWrapper ];
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ openssl curl ]
|
||||
++ lib.optional stdenv.isDarwin Security;
|
||||
|
||||
|
@ -26,14 +26,12 @@ rustPlatform.buildRustPackage rec {
|
|||
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 \
|
||||
--prefix PATH : "${lib.makeBinPath [ nix ]}"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A files database for nixpkgs";
|
||||
homepage = "https://github.com/bennofs/nix-index";
|
||||
license = with licenses; [ bsd3 ];
|
||||
maintainers = [ maintainers.bennofs ];
|
||||
maintainers = with maintainers; [ bennofs ncfavier ];
|
||||
};
|
||||
}
|
||||
|
|
19
pkgs/tools/package-management/nix-index/wrapper.nix
Normal file
19
pkgs/tools/package-management/nix-index/wrapper.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ lib, symlinkJoin, nix-index-unwrapped, makeWrapper, nix }:
|
||||
|
||||
if nix == null then nix-index-unwrapped else
|
||||
symlinkJoin {
|
||||
inherit (nix-index-unwrapped) name;
|
||||
|
||||
paths = [ nix-index-unwrapped ];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/nix-index \
|
||||
--prefix PATH : ${lib.makeBinPath [ nix ]}
|
||||
'';
|
||||
|
||||
meta = nix-index-unwrapped.meta // {
|
||||
hydraPlatforms = [];
|
||||
};
|
||||
}
|
|
@ -31763,9 +31763,10 @@ with pkgs;
|
|||
nix-info = callPackage ../tools/nix/info { };
|
||||
nix-info-tested = nix-info.override { doCheck = true; };
|
||||
|
||||
nix-index = callPackage ../tools/package-management/nix-index {
|
||||
nix-index-unwrapped = callPackage ../tools/package-management/nix-index {
|
||||
inherit (darwin.apple_sdk.frameworks) Security;
|
||||
};
|
||||
nix-index = callPackage ../tools/package-management/nix-index/wrapper.nix { };
|
||||
|
||||
nix-linter = haskell.lib.justStaticExecutables (haskellPackages.nix-linter);
|
||||
|
||||
|
|
Loading…
Reference in a new issue