cargo-auditable-cargo-wrapper: use makeWrapper

This commit is contained in:
Alyssa Ross 2023-04-24 18:18:23 +00:00
parent d6856047c8
commit a19acef56f

View file

@ -1,10 +1,13 @@
{ lib, writeShellScriptBin, cargo, cargo-auditable }:
{ lib, runCommand, makeBinaryWrapper, cargo, cargo-auditable }:
(writeShellScriptBin "cargo" ''
export PATH="${lib.makeBinPath [ cargo cargo-auditable ]}:$PATH"
CARGO_AUDITABLE_IGNORE_UNSUPPORTED=1 exec cargo auditable "$@"
'') // {
runCommand "cargo" {
nativeBuildInputs = [ makeBinaryWrapper ];
meta = cargo-auditable.meta // {
mainProgram = "cargo";
};
}
} ''
mkdir -p $out/bin
makeWrapper ${cargo}/bin/cargo $out/bin/cargo \
--set CARGO_AUDITABLE_IGNORE_UNSUPPORTED 1 \
--prefix PATH : ${lib.makeBinPath [ cargo cargo-auditable ]}
''