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.
This commit is contained in:
Timothy DeHerrera 2022-05-25 18:19:03 -06:00 committed by Zhaofeng Li
parent 6e2d221388
commit 7681d26689

View file

@ -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: {