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.nix15
1 files changed, 15 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..6fa5207de6eb
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/rust/rust-analyzer/wrapper.nix
@@ -0,0 +1,15 @@
+{ lib, rustPlatform, runCommand, makeWrapper, rust-analyzer-unwrapped
+, pname ? "rust-analyzer"
+, version ? rust-analyzer-unwrapped.version
+  # Use name from `RUST_SRC_PATH`
+, rustSrc ? rustPlatform.rustLibSrc
+}:
+runCommand "${pname}-${version}" {
+  inherit pname version;
+  inherit (rust-analyzer-unwrapped) src meta;
+  nativeBuildInputs = [ makeWrapper ];
+} ''
+  mkdir -p $out/bin
+  makeWrapper ${rust-analyzer-unwrapped}/bin/rust-analyzer $out/bin/rust-analyzer \
+    --set-default RUST_SRC_PATH "${rustSrc}"
+''