lsp/presets/nushell: init

This commit is contained in:
Snoweuph 2026-04-11 18:05:02 +02:00
commit 2af349436f
No known key found for this signature in database
GPG key ID: BEFC41DA223CEC55
2 changed files with 30 additions and 0 deletions

View file

@ -5,6 +5,7 @@
./harper.nix
./intelephense.nix
./lemminx.nix
./nushell.nix
./ocaml-lsp.nix
./ols.nix
./openscad-lsp.nix

View file

@ -0,0 +1,29 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
inherit (lib.generators) mkLuaInline;
cfg = config.vim.lsp.presets.nushell;
in {
options.vim.lsp.presets.nushell = {
enable = mkEnableOption "the NuShell Language Server";
};
config = mkIf cfg.enable {
vim.lsp.servers.nushell = {
enable = true;
cmd = [(getExe pkgs.nushell) "--no-config-file" "--lsp"];
root_dir = mkLuaInline ''
function(bufnr, on_dir)
on_dir(vim.fs.root(bufnr, { '.git' }) or vim.fs.dirname(vim.api.nvim_buf_get_name(bufnr)))
end
'';
};
};
}