summary refs log tree commit diff
path: root/pkgs/development/compilers/rust/cargo-auditable-cargo-wrapper.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-04-24 18:18:23 +0000
committerAlyssa Ross <hi@alyssa.is>2023-04-24 23:41:03 +0000
commita19acef56f2d1c95ff1c346122d495f624445bc2 (patch)
treeb78fb9efda08370f56a6695055582cbcc3345c61 /pkgs/development/compilers/rust/cargo-auditable-cargo-wrapper.nix
parentd6856047c8765adf68b13f4b46c7d23e0d2d9cff (diff)
downloadnixpkgs-a19acef56f2d1c95ff1c346122d495f624445bc2.tar
nixpkgs-a19acef56f2d1c95ff1c346122d495f624445bc2.tar.gz
nixpkgs-a19acef56f2d1c95ff1c346122d495f624445bc2.tar.bz2
nixpkgs-a19acef56f2d1c95ff1c346122d495f624445bc2.tar.lz
nixpkgs-a19acef56f2d1c95ff1c346122d495f624445bc2.tar.xz
nixpkgs-a19acef56f2d1c95ff1c346122d495f624445bc2.tar.zst
nixpkgs-a19acef56f2d1c95ff1c346122d495f624445bc2.zip
cargo-auditable-cargo-wrapper: use makeWrapper
Diffstat (limited to 'pkgs/development/compilers/rust/cargo-auditable-cargo-wrapper.nix')
-rw-r--r--pkgs/development/compilers/rust/cargo-auditable-cargo-wrapper.nix15
1 files changed, 9 insertions, 6 deletions
diff --git a/pkgs/development/compilers/rust/cargo-auditable-cargo-wrapper.nix b/pkgs/development/compilers/rust/cargo-auditable-cargo-wrapper.nix
index b50097d5e66..bddd5735667 100644
--- a/pkgs/development/compilers/rust/cargo-auditable-cargo-wrapper.nix
+++ b/pkgs/development/compilers/rust/cargo-auditable-cargo-wrapper.nix
@@ -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 ]}
+''