mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-09 14:45:58 +01:00
feat: update lsp config
This commit is contained in:
parent
476991b5ef
commit
1ca507569d
2 changed files with 52 additions and 58 deletions
|
@ -8,61 +8,6 @@ with lib;
|
|||
with builtins; let
|
||||
cfg = config.vim.lsp;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
enable = mkEnableOption "neovim lsp support";
|
||||
formatOnSave = mkEnableOption "Format on save";
|
||||
nix = {
|
||||
enable = mkEnableOption "Nix LSP";
|
||||
server = mkOption {
|
||||
type = with types; enum ["rnix" "nil"];
|
||||
default = "nil";
|
||||
description = "Which LSP to use";
|
||||
};
|
||||
|
||||
pkg = mkOption {
|
||||
type = types.package;
|
||||
default =
|
||||
if (cfg.nix.server == "rnix")
|
||||
then pkgs.rnix-lsp
|
||||
else pkgs.nil;
|
||||
description = "The LSP package to use";
|
||||
};
|
||||
|
||||
formatter = mkOption {
|
||||
type = with types; enum ["nixpkgs-fmt" "alejandra"];
|
||||
default = "alejandra";
|
||||
description = "Which nix formatter to use";
|
||||
};
|
||||
};
|
||||
rust = {
|
||||
enable = mkEnableOption "Rust LSP";
|
||||
rustAnalyzerOpts = mkOption {
|
||||
type = types.str;
|
||||
default = ''
|
||||
["rust-analyzer"] = {
|
||||
experimental = {
|
||||
procAttrMacros = true,
|
||||
},
|
||||
},
|
||||
'';
|
||||
description = "options to pass to rust analyzer";
|
||||
};
|
||||
};
|
||||
python = mkEnableOption "Python LSP";
|
||||
clang = {
|
||||
enable = mkEnableOption "C language LSP";
|
||||
c_header = mkEnableOption "C syntax header files";
|
||||
cclsOpts = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
sql = mkEnableOption "SQL Language LSP";
|
||||
go = mkEnableOption "Go language LSP";
|
||||
ts = mkEnableOption "TS language LSP";
|
||||
zig.enable = mkEnableOption "Zig language LSP";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
let
|
||||
writeIf = cond: msg:
|
||||
|
|
|
@ -9,8 +9,57 @@ with builtins; let
|
|||
cfg = config.vim.lsp;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
/*
|
||||
...
|
||||
*/
|
||||
enable = mkEnableOption "neovim lsp support";
|
||||
formatOnSave = mkEnableOption "Format on save";
|
||||
nix = {
|
||||
enable = mkEnableOption "Nix LSP";
|
||||
server = mkOption {
|
||||
type = with types; enum ["rnix" "nil"];
|
||||
default = "nil";
|
||||
description = "Which LSP to use";
|
||||
};
|
||||
|
||||
pkg = mkOption {
|
||||
type = types.package;
|
||||
default =
|
||||
if (cfg.nix.server == "rnix")
|
||||
then pkgs.rnix-lsp
|
||||
else pkgs.nil;
|
||||
description = "The LSP package to use";
|
||||
};
|
||||
|
||||
formatter = mkOption {
|
||||
type = with types; enum ["nixpkgs-fmt" "alejandra"];
|
||||
default = "alejandra";
|
||||
description = "Which nix formatter to use";
|
||||
};
|
||||
};
|
||||
rust = {
|
||||
enable = mkEnableOption "Rust LSP";
|
||||
rustAnalyzerOpts = mkOption {
|
||||
type = types.str;
|
||||
default = ''
|
||||
["rust-analyzer"] = {
|
||||
experimental = {
|
||||
procAttrMacros = true,
|
||||
},
|
||||
},
|
||||
'';
|
||||
description = "options to pass to rust analyzer";
|
||||
};
|
||||
};
|
||||
python = mkEnableOption "Python LSP";
|
||||
clang = {
|
||||
enable = mkEnableOption "C language LSP";
|
||||
c_header = mkEnableOption "C syntax header files";
|
||||
cclsOpts = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
sql = mkEnableOption "SQL Language LSP";
|
||||
go = mkEnableOption "Go language LSP";
|
||||
ts = mkEnableOption "TS language LSP";
|
||||
zig.enable = mkEnableOption "Zig language LSP";
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue