about summary refs log tree commit diff
path: root/pkgs/misc/vscode-extensions/rust-analyzer/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/misc/vscode-extensions/rust-analyzer/default.nix')
-rw-r--r--pkgs/misc/vscode-extensions/rust-analyzer/default.nix11
1 files changed, 5 insertions, 6 deletions
diff --git a/pkgs/misc/vscode-extensions/rust-analyzer/default.nix b/pkgs/misc/vscode-extensions/rust-analyzer/default.nix
index 230ee383af3a..d19027fa5762 100644
--- a/pkgs/misc/vscode-extensions/rust-analyzer/default.nix
+++ b/pkgs/misc/vscode-extensions/rust-analyzer/default.nix
@@ -1,5 +1,5 @@
 # Update script: pkgs/development/tools/rust/rust-analyzer/update.sh
-{ lib, stdenv, vscode-utils, jq, rust-analyzer, nodePackages_10_x
+{ lib, stdenv, vscode-utils, jq, rust-analyzer, nodePackages
 , setDefaultServerPath ? true
 }:
 
@@ -10,7 +10,7 @@ let
   # Follow the unstable version of rust-analyzer, since the extension is not stable yet.
   inherit (rust-analyzer) version;
 
-  build-deps = nodePackages_10_x."rust-analyzer-build-deps-../../misc/vscode-extensions/rust-analyzer/build-deps";
+  build-deps = nodePackages."rust-analyzer-build-deps-../../misc/vscode-extensions/rust-analyzer/build-deps";
   # FIXME: Making a new derivation to link `node_modules` and run `npm run package`
   # will cause a build failure.
   vsix = build-deps.override {
@@ -32,12 +32,11 @@ in vscode-utils.buildVscodeExtension {
 
   nativeBuildInputs = lib.optional setDefaultServerPath jq;
 
-  postFixup = lib.optionalString setDefaultServerPath ''
-    package_json="$out/${publisher}.${pname}/package.json"
+  preInstall = lib.optionalString setDefaultServerPath ''
     jq '.contributes.configuration.properties."rust-analyzer.serverPath".default = $s' \
       --arg s "${rust-analyzer}/bin/rust-analyzer" \
-      $package_json >$package_json.new
-    mv $package_json.new $package_json
+      package.json >package.json.new
+    mv package.json.new package.json
   '';
 
   meta = with lib; {