about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix16
1 files changed, 16 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix
new file mode 100644
index 000000000000..8ca3ff1a6d20
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix
@@ -0,0 +1,16 @@
+{ lib, rustPlatform, runCommandNoCC, makeWrapper }:
+
+lib.makeOverridable ({
+  unwrapped,
+  pname ? "rust-analyzer",
+  version ? unwrapped.version,
+  rustcSrc ? rustPlatform.rustcSrc,
+}: runCommandNoCC "${pname}-${version}" {
+  inherit pname version;
+  inherit (unwrapped) src meta;
+  nativeBuildInputs = [ makeWrapper ];
+} ''
+  mkdir -p $out/bin
+  makeWrapper ${unwrapped}/bin/rust-analyzer $out/bin/rust-analyzer \
+    --set-default RUST_SRC_PATH "${rustcSrc}"
+'')