nvim-lsp: Add settings for rust-analyzer (#113)

* nvim-lsp: Add settings for rust-analyzer

Because the settings are quite complex they are auto-generated. This
commit adds the script creating it & the generated options.

* Update flake.nix

Co-authored-by: Pedro Alves <pta2002@users.noreply.github.com>
This commit is contained in:
traxys 2023-01-21 18:15:46 +01:00 committed by GitHub
parent 5b84bbb513
commit 2f2f724f6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 1846 additions and 2 deletions

View file

@ -35,10 +35,49 @@
(system:
let
pkgs = import nixpkgs { inherit system; };
extractRustAnalyzer = { stdenv, pkgs }: stdenv.mkDerivation {
pname = "extract_rust_analyzer";
version = "master";
dontUnpack = true;
dontBuild = true;
buildInputs = [ pkgs.python3 ];
installPhase = ''
ls -la
mkdir -p $out/bin
cp ${./helpers/extract_rust_analyzer.py} $out/bin/extract_rust_analyzer.py
'';
};
extractRustAnalyzerPkg = pkgs.callPackage extractRustAnalyzer { };
in
{
packages.docs = pkgs.callPackage (import ./docs.nix) {
modules = nixvimModules;
packages = {
docs = pkgs.callPackage (import ./docs.nix) {
modules = nixvimModules;
};
runUpdates = pkgs.callPackage
({ pkgs, stdenv }: stdenv.mkDerivation {
pname = "run-updates";
version = pkgs.rust-analyzer.version;
src = pkgs.rust-analyzer.src;
nativeBuildInputs = with pkgs; [extractRustAnalyzerPkg alejandra nixpkgs-fmt];
buildPhase = ''
extract_rust_analyzer.py editors/code/package.json |
alejandra --quiet |
nixpkgs-fmt > rust-analyzer-config.nix
'';
installPhase = ''
mkdir -p $out/share
cp rust-analyzer-config.nix $out/share
'';
})
{ };
};
legacyPackages = rec {
makeNixvimWithModule = import ./wrappers/standalone.nix pkgs modules;