broken-rust

This commit is contained in:
u2515h
2024-01-14 17:30:57 +01:00
parent 3368536455
commit 2a99ca3ef9
4 changed files with 13 additions and 156 deletions

View File

@@ -20,7 +20,6 @@ in
{
programs.neovim = {
# https://github.com/nix-community/home-manager/blob/master/modules/programs/neovim.nix
enable = true;
vimAlias = true;
@@ -32,10 +31,10 @@ in
diffview-nvim
vim-airline
zephyr-nvim
vim-nix
vim-toml
elm-vim
vim-markdown
vim-mergetool
split-term-vim
# vim-grammarous
markdown-preview-nvim
@@ -60,19 +59,14 @@ in
cmp-cmdline
rustaceanvim
(if config.programs.neovim.package.version == "0.10.0" then throw "lsp-inlayhints-nvim may be removed" else lsp-inlayhints-nvim) # https://github.com/mrcjkb/rustaceanvim/discussions/46#discussioncomment-7620822
cmp-conventionalcommits
cmp-calc
cmp-cmdline
rustaceanvim
(if config.programs.neovim.package.version == "0.10.0" then throw "lsp-inlayhints-nvim may be removed" else lsp-inlayhints-nvim) # https://github.com/mrcjkb/rustaceanvim/discussions/46#discussioncomment-7620822
plenary-nvim
crates-nvim
nvim-lspconfig
telescope-nvim
telescope-undo-nvim
oil-nvim
distant-nvim
];
extraLuaConfig =
let
# tries to compute a package set required to make package resolution in lua
@@ -83,7 +77,7 @@ in
{ nativeBuildInputs = [ pkgs.gnused ]; __contentAddressed = true; } ''
sed -nr 's/.*(deps\.(.*)_path|deps\["(.*)"\]).*/\2/p' ${file} | uniq > $out
'');
names = lib.splitString "\n" (lib.traceVal out);
names = lib.splitString "\n" out;
in
filter (name: name != "") names;
paths = (listToAttrs (map (name: { inherit name; value = builtins.getAttr name pkgs; }) (packages "${confDir}/*.lua"))) // {
@@ -91,14 +85,13 @@ in
rust_analyzer = rust-analyzer;
typst_lsp = pkgs.typst-lsp;
};
pathsLua = pkgs.writeTextFile {
name = "nvim-deps.lua";
text = ''
pathsLua = let name = "nvim-deps.lua"; in (pkgs.writeTextDir "/${name}"
''
deps = {}
${concatStringsSep "\n " (mapAttrsToList (name: path: ''deps["${name}_path"] = "${path}"'') paths)}
${concatStringsSep "\n" (mapAttrsToList (name: path: ''deps["${name}_path"] = "${path}"'') paths)}
return deps
'';
};
'') + "/${name}";
confDir = lib.sourceFilesBySuffices ./. [ "lua" "vim" ];
in
with lib; ''