mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 13:20:44 +00:00
Compare commits
10 commits
55666d6b4c
...
c9dbfc6354
Author | SHA1 | Date | |
---|---|---|---|
|
c9dbfc6354 | ||
|
6adb4cff21 | ||
|
c360f29e25 | ||
|
415ed89340 | ||
|
f445bd1d4d | ||
|
dfdad4c2ce | ||
43e3663b2b | |||
|
b302e151e1 | ||
0ba3ccdab8 | |||
|
1bd0ae5f7e |
8 changed files with 108 additions and 15 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;
|
||||
|
|
|
@ -285,6 +285,9 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
|||
- Add [](#opt-vim.spellcheck.extraSpellWords) to allow adding arbitrary
|
||||
spellfiles to Neovim's runtime with ease.
|
||||
|
||||
- Add combined nvf configuration (`config.vim`) into the final package's
|
||||
passthru as `passthru.neovimConfiguration` for easier debugging.
|
||||
|
||||
[ppenguin](https://github.com/ppenguin):
|
||||
|
||||
- Telescope:
|
||||
|
@ -302,6 +305,8 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
|||
`vim.languages.kotlin`
|
||||
- changed default keybinds for leap.nvim to avoid altering expected behavior
|
||||
- Add LSP, formatter and Treesitter support for Vala under `vim.languages.vala`
|
||||
- Add [Tinymist](https://github.com/Myriad-Dreamin/tinymist] as a formatter for
|
||||
the Typst language module.
|
||||
|
||||
[Bloxx12](https://github.com/Bloxx12)
|
||||
|
||||
|
@ -326,4 +331,3 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
|||
[Nowaaru](https://github.com/Nowaaru):
|
||||
|
||||
- Add `precognition-nvim`.
|
||||
|
||||
|
|
|
@ -123,6 +123,11 @@ in {
|
|||
paths = [neovim-wrapped printConfig printConfigPath];
|
||||
postBuild = "echo Helpers added";
|
||||
|
||||
# Allow evaluating vimOptions, i.e., config.vim from the packages' passthru
|
||||
# attribute. For example, packages.x86_64-linux.neovim.passthru.neovimConfig
|
||||
# will return the configuration in full.
|
||||
passthru.neovimConfig = vimOptions;
|
||||
|
||||
meta = {
|
||||
description = "Wrapped version of Neovim with additional helper scripts";
|
||||
mainProgram = "nvim";
|
||||
|
|
|
@ -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"},
|
||||
}
|
||||
'';
|
||||
})
|
||||
]);
|
||||
}
|
|
@ -14,6 +14,38 @@
|
|||
|
||||
cfg = config.vim.languages.typst;
|
||||
|
||||
defaultServer = "tinymist";
|
||||
servers = {
|
||||
typst-lsp = {
|
||||
package = pkgs.typst-lsp;
|
||||
lspConfig = ''
|
||||
lspconfig.typst_lsp.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = default_on_attach,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/typst-lsp"}''
|
||||
},
|
||||
}
|
||||
'';
|
||||
};
|
||||
tinymist = {
|
||||
package = pkgs.tinymist;
|
||||
lspConfig = ''
|
||||
lspconfig.tinymist.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = default_on_attach,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/tinymist"}''
|
||||
},
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
defaultFormat = "typstfmt";
|
||||
formats = {
|
||||
typstfmt = {
|
||||
|
@ -52,11 +84,17 @@ in {
|
|||
lsp = {
|
||||
enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.languages.enableLSP;};
|
||||
|
||||
server = mkOption {
|
||||
description = "Typst LSP server to use";
|
||||
type = enum (attrNames servers);
|
||||
default = defaultServer;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "typst-lsp package, or the command to run as a list of strings";
|
||||
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
||||
type = either package (listOf str);
|
||||
default = pkgs.typst-lsp;
|
||||
default = servers.${cfg.lsp.server}.package;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -82,19 +120,14 @@ in {
|
|||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources.typst-format = formats.${cfg.format.type}.nullConfig;
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.lspconfig.enable = true;
|
||||
vim.lsp.lspconfig.sources.typst-lsp = ''
|
||||
lspconfig.typst_lsp.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach=default_on_attach,
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
else ''{"${cfg.lsp.package}/bin/typst-lsp"}''
|
||||
},
|
||||
}
|
||||
'';
|
||||
vim.lsp.lspconfig.sources.typst-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ in {
|
|||
enable = mkEnableOption "Neovim dev icons [nvim-web-devicons]";
|
||||
|
||||
setupOpts = mkPluginSetupOption "nvim-web-devicons" {
|
||||
color_icons = mkEnableOption "different highlight colors per icon";
|
||||
color_icons = mkEnableOption "different highlight colors per icon" // {default = true;};
|
||||
variant = mkOption {
|
||||
type = nullOr (enum ["light" "dark"]);
|
||||
default = null;
|
||||
|
|
|
@ -189,7 +189,7 @@ in {
|
|||
};
|
||||
|
||||
plugins = mkOption {
|
||||
default = [];
|
||||
default = {};
|
||||
type = attrsOf lznPluginType;
|
||||
description = ''
|
||||
Plugins to lazy load.
|
||||
|
|
Loading…
Reference in a new issue