mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-08 09:09:49 +01:00
Compare commits
2 commits
087b38383a
...
7a8ab4fcc1
Author | SHA1 | Date | |
---|---|---|---|
|
7a8ab4fcc1 | ||
|
291fb06eca |
2 changed files with 10 additions and 5 deletions
|
@ -10,13 +10,15 @@
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAfter;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (pkgs) haskellPackages;
|
inherit (pkgs) haskellPackages;
|
||||||
|
|
||||||
cfg = config.vim.languages.haskell;
|
cfg = config.vim.languages.haskell;
|
||||||
in {
|
in {
|
||||||
options.vim.languages.haskell = {
|
options.vim.languages.haskell = {
|
||||||
enable = mkEnableOption "Haskell support";
|
enable = mkEnableOption "Haskell support";
|
||||||
|
|
||||||
treesitter = {
|
treesitter = {
|
||||||
enable = mkEnableOption "Treesitter support for Haskell" // {default = config.vim.languages.enableTreesitter;};
|
enable = mkEnableOption "Treesitter support for Haskell" // {default = config.vim.languages.enableTreesitter;};
|
||||||
package = mkGrammarOption pkgs "haskell";
|
package = mkGrammarOption pkgs "haskell";
|
||||||
|
@ -41,6 +43,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
(mkIf cfg.treesitter.enable {
|
(mkIf cfg.treesitter.enable {
|
||||||
vim.treesitter = {
|
vim.treesitter = {
|
||||||
|
@ -48,11 +51,13 @@ in {
|
||||||
grammars = [cfg.treesitter.package];
|
grammars = [cfg.treesitter.package];
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf (cfg.dap.enable || cfg.lsp.enable) {
|
(mkIf (cfg.dap.enable || cfg.lsp.enable) {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = ["haskell-tools-nvim"];
|
startPlugins = ["haskell-tools-nvim"];
|
||||||
luaConfigRC.haskell-tools-nvim =
|
luaConfigRC.haskell-tools-nvim =
|
||||||
entryAnywhere
|
entryAfter
|
||||||
|
["lsp-setup"]
|
||||||
''
|
''
|
||||||
vim.g.haskell_tools = {
|
vim.g.haskell_tools = {
|
||||||
${optionalString cfg.lsp.enable ''
|
${optionalString cfg.lsp.enable ''
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
inherit (lib.types) bool package str listOf either enum;
|
inherit (lib.types) bool package str listOf either enum;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAfter;
|
||||||
|
|
||||||
cfg = config.vim.languages.rust;
|
cfg = config.vim.languages.rust;
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ in {
|
||||||
startPlugins = ["crates-nvim"];
|
startPlugins = ["crates-nvim"];
|
||||||
lsp.null-ls.enable = mkIf cfg.crates.codeActions true;
|
lsp.null-ls.enable = mkIf cfg.crates.codeActions true;
|
||||||
autocomplete.nvim-cmp.sources = {crates = "[Crates]";};
|
autocomplete.nvim-cmp.sources = {crates = "[Crates]";};
|
||||||
pluginRC.rust-crates = entryAnywhere ''
|
pluginRC.rust-crates = entryAfter ["lsp-setup"] ''
|
||||||
require('crates').setup {
|
require('crates').setup {
|
||||||
null_ls = {
|
null_ls = {
|
||||||
enabled = ${boolToString cfg.crates.codeActions},
|
enabled = ${boolToString cfg.crates.codeActions},
|
||||||
|
@ -127,7 +127,7 @@ in {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = ["rustaceanvim"];
|
startPlugins = ["rustaceanvim"];
|
||||||
|
|
||||||
luaConfigRC.rustaceanvim = entryAnywhere ''
|
luaConfigRC.rustaceanvim = entryAfter ["lsp-setup"] ''
|
||||||
vim.g.rustaceanvim = {
|
vim.g.rustaceanvim = {
|
||||||
${optionalString cfg.lsp.enable ''
|
${optionalString cfg.lsp.enable ''
|
||||||
-- LSP
|
-- LSP
|
||||||
|
|
Loading…
Reference in a new issue