mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 13:20:44 +00:00
Merge 8268f13bdd
into 57067e85ed
This commit is contained in:
commit
55666d6b4c
3 changed files with 51 additions and 0 deletions
|
@ -63,6 +63,7 @@ isMaximal: {
|
|||
dart.enable = isMaximal;
|
||||
bash.enable = isMaximal;
|
||||
r.enable = isMaximal;
|
||||
haskell.enable = isMaximal;
|
||||
tailwind.enable = isMaximal;
|
||||
typst.enable = isMaximal;
|
||||
clang.enable = isMaximal;
|
||||
|
|
|
@ -9,6 +9,7 @@ in {
|
|||
./elixir.nix
|
||||
./go.nix
|
||||
./kotlin.nix
|
||||
./haskell.nix
|
||||
./html.nix
|
||||
./java.nix
|
||||
./lua.nix
|
||||
|
|
49
modules/plugins/languages/haskell.nix
Normal file
49
modules/plugins/languages/haskell.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) package;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
|
||||
cfg = config.vim.languages.haskell;
|
||||
in {
|
||||
options.vim.languages.haskell = {
|
||||
enable = mkEnableOption "Haskell support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Haskell treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "haskell";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "Haskell LSP support (haskell-language-server)" // {default = config.vim.languages.enableLSP;};
|
||||
|
||||
package = mkOption {
|
||||
description = "haskell-language-server package";
|
||||
type = package;
|
||||
default = pkgs.haskell-language-server;
|
||||
};
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
vim.lsp.lspconfig.sources.hls = ''
|
||||
lspconfig.hls.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = default_on_attach,
|
||||
cmd = {"${cfg.lsp.package}/bin/haskell-language-server"},
|
||||
}
|
||||
'';
|
||||
})
|
||||
]);
|
||||
}
|
Loading…
Reference in a new issue