mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-02-27 21:41:29 +00:00
Compare commits
6 commits
6329e7b9ff
...
903a4cd86a
Author | SHA1 | Date | |
---|---|---|---|
![]() |
903a4cd86a | ||
![]() |
da86e554a6 | ||
![]() |
8268f13bdd | ||
![]() |
accd26bd83 | ||
![]() |
b7f296f170 | ||
![]() |
cccde8b6fd |
5 changed files with 53 additions and 1 deletions
|
@ -63,6 +63,7 @@ isMaximal: {
|
||||||
dart.enable = isMaximal;
|
dart.enable = isMaximal;
|
||||||
bash.enable = isMaximal;
|
bash.enable = isMaximal;
|
||||||
r.enable = isMaximal;
|
r.enable = isMaximal;
|
||||||
|
haskell.enable = isMaximal;
|
||||||
tailwind.enable = isMaximal;
|
tailwind.enable = isMaximal;
|
||||||
typst.enable = isMaximal;
|
typst.enable = isMaximal;
|
||||||
clang = {
|
clang = {
|
||||||
|
|
|
@ -279,6 +279,7 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
||||||
- Add LSP and Treesitter support for R under `vim.languages.R`.
|
- Add LSP and Treesitter support for R under `vim.languages.R`.
|
||||||
- Add Otter support under `vim.lsp.otter` and an assert to prevent conflict with
|
- Add Otter support under `vim.lsp.otter` and an assert to prevent conflict with
|
||||||
ccc
|
ccc
|
||||||
|
- Fixed typo in Otter's setupOpts
|
||||||
- Add Neorg support under `vim.notes.neorg`
|
- Add Neorg support under `vim.notes.neorg`
|
||||||
- Add LSP, diagnostics, formatter and Treesitter support for Kotlin under
|
- Add LSP, diagnostics, formatter and Treesitter support for Kotlin under
|
||||||
`vim.languages.kotlin`
|
`vim.languages.kotlin`
|
||||||
|
|
|
@ -9,6 +9,7 @@ in {
|
||||||
./elixir.nix
|
./elixir.nix
|
||||||
./go.nix
|
./go.nix
|
||||||
./kotlin.nix
|
./kotlin.nix
|
||||||
|
./haskell.nix
|
||||||
./html.nix
|
./html.nix
|
||||||
./java.nix
|
./java.nix
|
||||||
./lua.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"},
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
|
@ -32,7 +32,7 @@ in {
|
||||||
|
|
||||||
pluginRC.otter-nvim = entryAnywhere ''
|
pluginRC.otter-nvim = entryAnywhere ''
|
||||||
-- Enable otter diagnostics viewer
|
-- Enable otter diagnostics viewer
|
||||||
require("otter").setup({${toLuaObject cfg.otter-nvim.setupOpts}})
|
require("otter").setup(${toLuaObject cfg.otter-nvim.setupOpts})
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue