From 2aeab62880405e0696d406fc042e5b010330f160 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Sat, 8 Jan 2022 01:20:36 -0800 Subject: [PATCH] Bundle rust-analyzer in dev environment The user's rust-analyzer may be of the wrong version. --- flake.nix | 2 +- nix/rust-analyzer.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100755 nix/rust-analyzer.sh diff --git a/flake.nix b/flake.nix index 7f90fe7..e983382 100644 --- a/flake.nix +++ b/flake.nix @@ -52,7 +52,7 @@ devShell = pkgs.mkShell { inputsFrom = [ defaultPackage ]; - packages = with pkgs; [ clippy mdbook python3 ]; + packages = with pkgs; [ clippy mdbook python3 rust-analyzer ]; shellHook = '' export NIX_PATH=nixpkgs=${pkgs.path} ''; diff --git a/nix/rust-analyzer.sh b/nix/rust-analyzer.sh new file mode 100755 index 0000000..3e6bfd6 --- /dev/null +++ b/nix/rust-analyzer.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash ../shell.nix + +exec rust-analyzer "$@"