2021-04-12 18:23:04 +00:00
|
|
|
{ lib, rustPlatform, runCommand, makeWrapper, rust-analyzer-unwrapped
|
|
|
|
, pname ? "rust-analyzer"
|
|
|
|
, version ? rust-analyzer-unwrapped.version
|
2020-11-09 15:59:12 +00:00
|
|
|
# Use name from `RUST_SRC_PATH`
|
2021-04-12 18:23:04 +00:00
|
|
|
, rustSrc ? rustPlatform.rustLibSrc
|
|
|
|
}:
|
|
|
|
runCommand "${pname}-${version}" {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit pname version;
|
2021-04-12 18:23:04 +00:00
|
|
|
inherit (rust-analyzer-unwrapped) src meta;
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
} ''
|
|
|
|
mkdir -p $out/bin
|
2021-04-12 18:23:04 +00:00
|
|
|
makeWrapper ${rust-analyzer-unwrapped}/bin/rust-analyzer $out/bin/rust-analyzer \
|
2020-11-09 15:59:12 +00:00
|
|
|
--set-default RUST_SRC_PATH "${rustSrc}"
|
2021-04-12 18:23:04 +00:00
|
|
|
''
|