2020-01-18 19:34:16 +00:00
|
|
|
{ lib, rustPlatform, runCommandNoCC, makeWrapper }:
|
|
|
|
|
|
|
|
lib.makeOverridable ({
|
|
|
|
unwrapped,
|
|
|
|
pname ? "rust-analyzer",
|
|
|
|
version ? unwrapped.version,
|
2020-11-06 16:31:25 +00:00
|
|
|
# Use name from `RUST_SRC_PATH`
|
|
|
|
rustSrc ? rustPlatform.rustLibSrc,
|
2020-01-18 19:34:16 +00:00
|
|
|
}: 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 \
|
2020-11-06 16:31:25 +00:00
|
|
|
--set-default RUST_SRC_PATH "${rustSrc}"
|
2020-01-18 19:34:16 +00:00
|
|
|
'')
|