From 7681d26689e65ce7b20dc26b59c78ea6eeabc908 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Wed, 25 May 2022 18:19:03 -0600 Subject: [PATCH] flake.nix: add RUST_SRC_PATH for rust-analyzer Allow for a rust-analyzer language server running in the devshell to access the same rust sources used to build the package. --- flake.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 82a70dd..1354ea9 100644 --- a/flake.nix +++ b/flake.nix @@ -58,14 +58,14 @@ }; devShell = pkgs.mkShell { + RUST_SRC_PATH = "${pkgs.rustPlatform.rustcSrc}/library"; + NIX_PATH = "nixpkgs=${pkgs.path}"; + inputsFrom = [ defaultPackage packages.manualFast ]; packages = with pkgs; [ python3 editorconfig-checker clippy rust-analyzer cargo-outdated ]; - shellHook = '' - export NIX_PATH=nixpkgs=${pkgs.path} - ''; }; }) // { overlay = final: prev: {