treewide: format with new treefmt

This commit is contained in:
Gaetan Lepage 2025-07-25 16:27:30 +02:00 committed by Gaétan Lepage
parent c61851aff7
commit 8529f1c86b
34 changed files with 688 additions and 702 deletions

View file

@ -7,79 +7,78 @@ let
];
in
{
imports =
[
(mkRemovedOptionModule (basePluginPath ++ [ "server" ]) ''
To configure the `clangd` language server options, please use
`plugins.lsp.servers.clangd.extraSettings`.
'')
(mkRemovedOptionModule (
basePluginPath
++ [
"extensions"
"autoSetHints"
]
) "")
]
++ (map
(
optionPath:
mkRenamedOptionModule (basePluginPath ++ [ "extensions" ] ++ optionPath) (
basePluginPath ++ optionPath
)
)
[
[
"inlayHints"
"inline"
]
[
"inlayHints"
"onlyCurrentLine"
]
[
"inlayHints"
"onlyCurrentLineAutocmd"
]
[
"inlayHints"
"showParameterHints"
]
[
"inlayHints"
"parameterHintsPrefix"
]
[
"inlayHints"
"otherHintsPrefix"
]
[
"inlayHints"
"maxLenAlign"
]
[
"inlayHints"
"maxLenAlignPadding"
]
[
"inlayHints"
"rightAlign"
]
[
"inlayHints"
"rightAlignPadding"
]
[
"inlayHints"
"highlight"
]
[
"inlayHints"
"priority"
]
[ "ast" ]
[ "memoryUsage" ]
[ "symbolInfo" ]
imports = [
(mkRemovedOptionModule (basePluginPath ++ [ "server" ]) ''
To configure the `clangd` language server options, please use
`plugins.lsp.servers.clangd.extraSettings`.
'')
(mkRemovedOptionModule (
basePluginPath
++ [
"extensions"
"autoSetHints"
]
);
) "")
]
++ (map
(
optionPath:
mkRenamedOptionModule (basePluginPath ++ [ "extensions" ] ++ optionPath) (
basePluginPath ++ optionPath
)
)
[
[
"inlayHints"
"inline"
]
[
"inlayHints"
"onlyCurrentLine"
]
[
"inlayHints"
"onlyCurrentLineAutocmd"
]
[
"inlayHints"
"showParameterHints"
]
[
"inlayHints"
"parameterHintsPrefix"
]
[
"inlayHints"
"otherHintsPrefix"
]
[
"inlayHints"
"maxLenAlign"
]
[
"inlayHints"
"maxLenAlignPadding"
]
[
"inlayHints"
"rightAlign"
]
[
"inlayHints"
"rightAlignPadding"
]
[
"inlayHints"
"highlight"
]
[
"inlayHints"
"priority"
]
[ "ast" ]
[ "memoryUsage" ]
[ "symbolInfo" ]
]
);
}

View file

@ -7,9 +7,10 @@ lib.nixvim.plugins.mkNeovimPlugin {
maintainers = [ lib.maintainers.GaetanLepage ];
imports =
[ { cmpSourcePlugins.crates = "crates"; } ]
++
imports = [
{ cmpSourcePlugins.crates = "crates"; }
]
++
# TODO introduced 2024-12-12: remove after 25.05
lib.nixvim.mkSettingsRenamedOptionModules [ "plugins" "crates-nvim" ]
[ "plugins" "crates" ]

View file

@ -79,23 +79,22 @@ lib.nixvim.plugins.mkNeovimPlugin {
plugins.dap = {
enable = true;
extensionConfigLua =
''
require("dap-python").setup("${cfg.adapterPythonPath}", ${toLuaObject cfg.settings})
''
+ (optionalString (cfg.testRunners != null) ''
table.insert(require("dap-python").test_runners,
${toLuaObject (builtins.mapAttrs (_: lib.nixvim.mkRaw) cfg.testRunners)})
'')
+ (optionalString (cfg.customConfigurations != null) ''
table.insert(require("dap").configurations.python, ${toLuaObject cfg.customConfigurations})
'')
+ (optionalString (cfg.resolvePython != null) ''
require("dap-python").resolve_python = ${toLuaObject cfg.resolvePython}
'')
+ (optionalString (cfg.testRunner != null) ''
require("dap-python").test_runner = ${toLuaObject cfg.testRunner};
'');
extensionConfigLua = ''
require("dap-python").setup("${cfg.adapterPythonPath}", ${toLuaObject cfg.settings})
''
+ (optionalString (cfg.testRunners != null) ''
table.insert(require("dap-python").test_runners,
${toLuaObject (builtins.mapAttrs (_: lib.nixvim.mkRaw) cfg.testRunners)})
'')
+ (optionalString (cfg.customConfigurations != null) ''
table.insert(require("dap").configurations.python, ${toLuaObject cfg.customConfigurations})
'')
+ (optionalString (cfg.resolvePython != null) ''
require("dap-python").resolve_python = ${toLuaObject cfg.resolvePython}
'')
+ (optionalString (cfg.testRunner != null) ''
require("dap-python").test_runner = ${toLuaObject cfg.testRunner};
'');
};
};

View file

@ -34,7 +34,8 @@ rec {
The filetype to use for content retrieved via a source request.
'';
};
} // attrs;
}
// attrs;
};
executableAdapterOption = mkAdapterType {

View file

@ -79,7 +79,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
DapStopped = dapStopped;
DapBreakpointRejected = dapBreakpointRejected;
};
} // cfg.settings;
}
// cfg.settings;
in
{
plugins.dap.luaConfig.content = lib.mkMerge [

View file

@ -191,7 +191,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
action = "Telescope find_files cwd=";
```
'';
} // extraOptions;
}
// extraOptions;
};
in
{

View file

@ -16,23 +16,23 @@ lib.nixvim.plugins.mkVimPlugin {
maintainers = [ lib.maintainers.GaetanLepage ];
# TODO: Added 2024-12-16; remove after 25.05
optionsRenamedToSettings =
[
"autoclose"
"autohide"
"autoinsert"
"borderchars"
"giteditor"
"height"
"opener"
"position"
"rootmarkers"
"shell"
"title"
"width"
"wintype"
]
++ map
optionsRenamedToSettings = [
"autoclose"
"autohide"
"autoinsert"
"borderchars"
"giteditor"
"height"
"opener"
"position"
"rootmarkers"
"shell"
"title"
"width"
"wintype"
]
++
map
(name: {
old = [
"keymaps"

View file

@ -71,210 +71,209 @@ lib.nixvim.plugins.mkVimPlugin {
];
};
settingsOptions =
{
preview_win_location = defaultNullOpts.mkEnumFirstDefault [ "bo" "to" "bel" "abo" ] ''
This option determines where the preview window pops up as a result of the
`:GitGutterPreviewHunk` command.
settingsOptions = {
preview_win_location = defaultNullOpts.mkEnumFirstDefault [ "bo" "to" "bel" "abo" ] ''
This option determines where the preview window pops up as a result of the
`:GitGutterPreviewHunk` command.
See the end of the `|opening-window|` docs.
'';
See the end of the `|opening-window|` docs.
'';
git_executable = defaultNullOpts.mkStr' {
pluginDefault = "git";
example = lib.literalExpression "lib.getExe pkgs.git";
description = ''
This option determines what `git` binary to use.
Set this if git is not on your path.
'';
};
git_args = defaultNullOpts.mkStr' {
pluginDefault = "";
example = ''--gitdir=""'';
description = ''
Use this option to pass any extra arguments to `git` when running `git-diff`.
'';
};
diff_args = defaultNullOpts.mkStr' {
pluginDefault = "";
example = "-w";
description = ''
Use this option to pass any extra arguments to `git-diff`.
'';
};
diff_relative_to = defaultNullOpts.mkStr' {
pluginDefault = "index";
example = "working_tree";
description = ''
By default buffers are diffed against the index.
Use this option to diff against the working tree.
'';
};
diff_base = defaultNullOpts.mkStr' {
pluginDefault = "";
example = "";
description = ''
By default buffers are diffed against the index.
Use this option to diff against a revision instead.
If you are looking at a previous version of a file with _Fugitive_ (e.g. via `:0Gclog`),
gitgutter sets the diff base to the parent of the current revision.
This setting is ignore when the diff is relative to the working tree (`diff_relative_to`).
'';
};
grep = defaultNullOpts.mkStr' {
pluginDefault = "grep";
example = "grep --color=never";
description = ''
The plugin pipes the output of `git-diff` into `grep` to minimise the amount of data vim has
to process.
Set this option if `grep` is not on your path.
`grep` must produce plain-text output without any ANSI escape codes or colours.
Use this option to turn off colours if necessary (`grep --color=never` for example).
If you do not want to use `grep` at all (perhaps to debug why signs are not showing), set
this option to an empty string.
'';
};
signs = defaultNullOpts.mkBool true ''
Determines whether or not to show signs.
'';
highlight_lines = defaultNullOpts.mkBool false ''
Determines whether or not to show line highlights.
'';
highlight_linenrs = defaultNullOpts.mkBool false ''
Determines whether or not to show line number highlights.
'';
max_signs = defaultNullOpts.mkInt (-1) ''
Sets the maximum number of signs to show in a buffer.
To avoid slowing down the GUI the number of signs can be capped.
When the number of changed lines exceeds this value, the plugin removes all signs and displays
a warning message.
When set to `-1` the limit is not applied.
'';
sign_priority = defaultNullOpts.mkUnsignedInt 10 ''
Sets the `|sign-priority|` gitgutter assigns to its signs.
'';
sign_allow_clobber = defaultNullOpts.mkBool true ''
Determines whether gitgutter preserves non-gitgutter signs.
When `true`, gitgutter will not preserve non-gitgutter signs.
'';
}
// (lib.mapAttrs'
(n: default: {
name = "sign_${n}";
value = defaultNullOpts.mkStr default ''
Icon for the _${n}_ sign.
You can use unicode characters but not images.
Signs must not take up more than 2 columns.
'';
})
{
added = "+";
modified = "~";
removed = "_";
removed_first_line = "";
removed_above_and_below = "_¯";
modified_removed = "~_";
}
)
// {
set_sign_backgrounds = defaultNullOpts.mkBool false ''
Only applies to existing `GitGutter*` highlight groups.
See `|gitgutter-highlights|`.
Controls whether to override the signs' background colours to match the `|hl-SignColumn|`.
'';
preview_win_floating = defaultNullOpts.mkBool true ''
Whether to use floating/popup windows for hunk previews.
Note that if you use popup windows on Vim you will not be able to stage partial hunks via
the preview window.
'';
floating_window_options =
defaultNullOpts.mkAttrsOf types.anything
{
relative = "cursor";
row = 1;
col = 0;
width = 42;
height = "&previewheight";
style = "minimal";
}
''
This dictionary is passed directly to `|nvim_open_win()|`.
'';
close_preview_on_escape = defaultNullOpts.mkBool false ''
Whether pressing <Esc> in a preview window closes it.
'';
terminal_reports_focus = defaultNullOpts.mkBool true ''
Normally the plugin uses `|FocusGained|` to force-update all buffers when Vim receives
focus.
However some terminals do not report focus events and so the `|FocusGained|` autocommand
never fires.
If this applies to you, either install something like
[Terminus](https://github.com/wincent/terminus) to make `|FocusGained|` work or set this
option to `false`.
If you use `tmux`, try this in your tmux.conf:
```
set -g focus-events on
```
When this option is `false`, the plugin force-updates the buffer on `|BufEnter|` (instead of
only updating if the buffer's contents has changed since the last update).
'';
enabled = defaultNullOpts.mkBool true ''
Controls whether or not the plugin is on at startup.
'';
map_keys = defaultNullOpts.mkBool true ''
Controls whether or not the plugin provides mappings.
See `|gitgutter-mappings|`.
'';
async = defaultNullOpts.mkBool true ''
Controls whether or not diffs are run in the background.
'';
log = defaultNullOpts.mkBool false ''
When switched on, the plugin logs to `gitgutter.log` in the directory where it is installed.
Additionally it logs channel activity to `channel.log`.
'';
use_location_list = defaultNullOpts.mkBool false ''
When switched on, the `:GitGutterQuickFix` command populates the location list of the
current window instead of the global quickfix list.
'';
show_msg_on_hunk_jumping = defaultNullOpts.mkBool true ''
When switched on, a message like "Hunk 4 of 11" is shown on hunk jumping.
git_executable = defaultNullOpts.mkStr' {
pluginDefault = "git";
example = lib.literalExpression "lib.getExe pkgs.git";
description = ''
This option determines what `git` binary to use.
Set this if git is not on your path.
'';
};
git_args = defaultNullOpts.mkStr' {
pluginDefault = "";
example = ''--gitdir=""'';
description = ''
Use this option to pass any extra arguments to `git` when running `git-diff`.
'';
};
diff_args = defaultNullOpts.mkStr' {
pluginDefault = "";
example = "-w";
description = ''
Use this option to pass any extra arguments to `git-diff`.
'';
};
diff_relative_to = defaultNullOpts.mkStr' {
pluginDefault = "index";
example = "working_tree";
description = ''
By default buffers are diffed against the index.
Use this option to diff against the working tree.
'';
};
diff_base = defaultNullOpts.mkStr' {
pluginDefault = "";
example = "";
description = ''
By default buffers are diffed against the index.
Use this option to diff against a revision instead.
If you are looking at a previous version of a file with _Fugitive_ (e.g. via `:0Gclog`),
gitgutter sets the diff base to the parent of the current revision.
This setting is ignore when the diff is relative to the working tree (`diff_relative_to`).
'';
};
grep = defaultNullOpts.mkStr' {
pluginDefault = "grep";
example = "grep --color=never";
description = ''
The plugin pipes the output of `git-diff` into `grep` to minimise the amount of data vim has
to process.
Set this option if `grep` is not on your path.
`grep` must produce plain-text output without any ANSI escape codes or colours.
Use this option to turn off colours if necessary (`grep --color=never` for example).
If you do not want to use `grep` at all (perhaps to debug why signs are not showing), set
this option to an empty string.
'';
};
signs = defaultNullOpts.mkBool true ''
Determines whether or not to show signs.
'';
highlight_lines = defaultNullOpts.mkBool false ''
Determines whether or not to show line highlights.
'';
highlight_linenrs = defaultNullOpts.mkBool false ''
Determines whether or not to show line number highlights.
'';
max_signs = defaultNullOpts.mkInt (-1) ''
Sets the maximum number of signs to show in a buffer.
To avoid slowing down the GUI the number of signs can be capped.
When the number of changed lines exceeds this value, the plugin removes all signs and displays
a warning message.
When set to `-1` the limit is not applied.
'';
sign_priority = defaultNullOpts.mkUnsignedInt 10 ''
Sets the `|sign-priority|` gitgutter assigns to its signs.
'';
sign_allow_clobber = defaultNullOpts.mkBool true ''
Determines whether gitgutter preserves non-gitgutter signs.
When `true`, gitgutter will not preserve non-gitgutter signs.
'';
}
// (lib.mapAttrs'
(n: default: {
name = "sign_${n}";
value = defaultNullOpts.mkStr default ''
Icon for the _${n}_ sign.
You can use unicode characters but not images.
Signs must not take up more than 2 columns.
'';
})
{
added = "+";
modified = "~";
removed = "_";
removed_first_line = "";
removed_above_and_below = "_¯";
modified_removed = "~_";
}
)
// {
set_sign_backgrounds = defaultNullOpts.mkBool false ''
Only applies to existing `GitGutter*` highlight groups.
See `|gitgutter-highlights|`.
Controls whether to override the signs' background colours to match the `|hl-SignColumn|`.
'';
preview_win_floating = defaultNullOpts.mkBool true ''
Whether to use floating/popup windows for hunk previews.
Note that if you use popup windows on Vim you will not be able to stage partial hunks via
the preview window.
'';
floating_window_options =
defaultNullOpts.mkAttrsOf types.anything
{
relative = "cursor";
row = 1;
col = 0;
width = 42;
height = "&previewheight";
style = "minimal";
}
''
This dictionary is passed directly to `|nvim_open_win()|`.
'';
close_preview_on_escape = defaultNullOpts.mkBool false ''
Whether pressing <Esc> in a preview window closes it.
'';
terminal_reports_focus = defaultNullOpts.mkBool true ''
Normally the plugin uses `|FocusGained|` to force-update all buffers when Vim receives
focus.
However some terminals do not report focus events and so the `|FocusGained|` autocommand
never fires.
If this applies to you, either install something like
[Terminus](https://github.com/wincent/terminus) to make `|FocusGained|` work or set this
option to `false`.
If you use `tmux`, try this in your tmux.conf:
```
set -g focus-events on
```
When this option is `false`, the plugin force-updates the buffer on `|BufEnter|` (instead of
only updating if the buffer's contents has changed since the last update).
'';
enabled = defaultNullOpts.mkBool true ''
Controls whether or not the plugin is on at startup.
'';
map_keys = defaultNullOpts.mkBool true ''
Controls whether or not the plugin provides mappings.
See `|gitgutter-mappings|`.
'';
async = defaultNullOpts.mkBool true ''
Controls whether or not diffs are run in the background.
'';
log = defaultNullOpts.mkBool false ''
When switched on, the plugin logs to `gitgutter.log` in the directory where it is installed.
Additionally it logs channel activity to `channel.log`.
'';
use_location_list = defaultNullOpts.mkBool false ''
When switched on, the `:GitGutterQuickFix` command populates the location list of the
current window instead of the global quickfix list.
'';
show_msg_on_hunk_jumping = defaultNullOpts.mkBool true ''
When switched on, a message like "Hunk 4 of 11" is shown on hunk jumping.
'';
};
settingsExample = {
set_sign_backgrounds = true;
sign_modified_removed = "*";

View file

@ -66,15 +66,14 @@ lib.nixvim.plugins.mkVimPlugin {
};
extraOptions = {
keymaps =
{
silent = mkOption {
type = types.bool;
description = "Whether julia-cell keymaps should be silent";
default = false;
};
}
// (mapAttrs (name: value: helpers.mkNullOrOption types.str "Keymap for ${value.desc}.") mappings);
keymaps = {
silent = mkOption {
type = types.bool;
description = "Whether julia-cell keymaps should be silent";
default = false;
};
}
// (mapAttrs (name: value: helpers.mkNullOrOption types.str "Keymap for ${value.desc}.") mappings);
};
extraConfig = cfg: {

View file

@ -215,39 +215,38 @@ lib.nixvim.plugins.mkNeovimPlugin {
extraConfig = cfg: {
autoCmd = lib.optionals (cfg.autoCmd != null) [ cfg.autoCmd ];
plugins.lint.luaConfig.content =
''
local __lint = require('lint')
''
+ (lib.optionalString (cfg.lintersByFt != null) ''
__lint.linters_by_ft = ${toLuaObject cfg.lintersByFt}
'')
+ (lib.optionalString (cfg.customLinters != null) (
lib.concatLines (
plugins.lint.luaConfig.content = ''
local __lint = require('lint')
''
+ (lib.optionalString (cfg.lintersByFt != null) ''
__lint.linters_by_ft = ${toLuaObject cfg.lintersByFt}
'')
+ (lib.optionalString (cfg.customLinters != null) (
lib.concatLines (
lib.mapAttrsToList (
customLinter: linterConfig:
let
linterConfig' =
if builtins.isString linterConfig then lib.nixvim.mkRaw linterConfig else linterConfig;
in
"__lint.linters.${customLinter} = ${toLuaObject linterConfig'}"
) cfg.customLinters
)
))
+ (lib.optionalString (cfg.linters != null) (
lib.concatLines (
lib.flatten (
lib.mapAttrsToList (
customLinter: linterConfig:
let
linterConfig' =
if builtins.isString linterConfig then lib.nixvim.mkRaw linterConfig else linterConfig;
in
"__lint.linters.${customLinter} = ${toLuaObject linterConfig'}"
) cfg.customLinters
)
))
+ (lib.optionalString (cfg.linters != null) (
lib.concatLines (
lib.flatten (
linter: linterConfig:
lib.mapAttrsToList (
linter: linterConfig:
lib.mapAttrsToList (
propName: propValue:
lib.optionalString (
propValue != null
) "__lint.linters.${linter}.${propName} = ${toLuaObject propValue}"
) linterConfig
) cfg.linters
)
propName: propValue:
lib.optionalString (
propValue != null
) "__lint.linters.${linter}.${propName} = ${toLuaObject propValue}"
) linterConfig
) cfg.linters
)
));
)
));
};
}

View file

@ -54,22 +54,21 @@ in
config =
let
doCmp = cfg.cmp.enable && config.plugins.cmp.enable;
options =
{
inherit (cfg) mode preset;
symbol_map = cfg.symbolMap;
}
// (
if doCmp then
{
maxwidth = cfg.cmp.maxWidth;
ellipsis_char = cfg.cmp.ellipsisChar;
inherit (cfg.cmp) menu;
}
else
{ }
)
// cfg.extraOptions;
options = {
inherit (cfg) mode preset;
symbol_map = cfg.symbolMap;
}
// (
if doCmp then
{
maxwidth = cfg.cmp.maxWidth;
ellipsis_char = cfg.cmp.ellipsisChar;
inherit (cfg.cmp) menu;
}
else
{ }
)
// cfg.extraOptions;
in
mkIf cfg.enable {
extraPlugins = [ cfg.package ];

View file

@ -13,46 +13,45 @@ lib.nixvim.plugins.mkNeovimPlugin {
# TODO introduced 2024-02-29: remove 2024-04-29
deprecateExtraOptions = true;
imports =
imports = [
# TODO: added 2025-04-07, remove after 25.05
(lib.nixvim.mkRemovedPackageOptionModule {
plugin = "neogit";
packageName = "git";
})
(lib.nixvim.mkRemovedPackageOptionModule {
plugin = "neogit";
packageName = "which";
})
]
++ (map
(
optionPath:
mkRemovedOptionModule
(
[
"plugins"
"neogit"
]
++ optionPath
)
"This option has been removed upstream. Please refer to the plugin documentation to update your configuration."
)
[
# TODO: added 2025-04-07, remove after 25.05
(lib.nixvim.mkRemovedPackageOptionModule {
plugin = "neogit";
packageName = "git";
})
(lib.nixvim.mkRemovedPackageOptionModule {
plugin = "neogit";
packageName = "which";
})
]
++ (map
(
optionPath:
mkRemovedOptionModule
(
[
"plugins"
"neogit"
]
++ optionPath
)
"This option has been removed upstream. Please refer to the plugin documentation to update your configuration."
)
[ "disableCommitConfirmation" ]
[ "disableBuiltinNotifications" ]
[ "useMagitKeybindings " ]
[ "commitPopup" ]
[
[ "disableCommitConfirmation" ]
[ "disableBuiltinNotifications" ]
[ "useMagitKeybindings " ]
[ "commitPopup" ]
[
"sections"
"unmerged"
]
[
"sections"
"unpulled"
]
"sections"
"unmerged"
]
);
[
"sections"
"unpulled"
]
]
);
optionsRenamedToSettings = [
"disableSigns"
"disableHint"

View file

@ -14,38 +14,37 @@ let
cfg' = config.plugins.none-ls.sources.${sourceType}.${sourceName};
in
{
options.plugins.none-ls.sources.${sourceType}.${sourceName} =
{
enable = lib.mkEnableOption "the ${sourceName} ${sourceType} source for none-ls";
# Support strLua for compatibility with the old withArgs option
settings = lib.nixvim.defaultNullOpts.mkStrLuaOr' {
type = with lib.types; attrsOf anything;
description = ''
Options provided to the `require('null-ls').builtins.${sourceType}.${sourceName}.with` function.
options.plugins.none-ls.sources.${sourceType}.${sourceName} = {
enable = lib.mkEnableOption "the ${sourceName} ${sourceType} source for none-ls";
# Support strLua for compatibility with the old withArgs option
settings = lib.nixvim.defaultNullOpts.mkStrLuaOr' {
type = with lib.types; attrsOf anything;
description = ''
Options provided to the `require('null-ls').builtins.${sourceType}.${sourceName}.with` function.
See upstream's [`BUILTIN_CONFIG`] documentation.
See upstream's [`BUILTIN_CONFIG`] documentation.
[`BUILTIN_CONFIG`]: https://github.com/nvimtools/none-ls.nvim/blob/main/doc/BUILTIN_CONFIG.md
'';
example = {
extra_filetypes = [ "toml" ];
disabled_filetypes = [ "lua" ];
extra_args = [
"-i"
"2"
"-ci"
];
};
[`BUILTIN_CONFIG`]: https://github.com/nvimtools/none-ls.nvim/blob/main/doc/BUILTIN_CONFIG.md
'';
example = {
extra_filetypes = [ "toml" ];
disabled_filetypes = [ "lua" ];
extra_args = [
"-i"
"2"
"-ci"
];
};
}
# Only declare a package option if a package is required
// lib.optionalAttrs (packaged ? ${sourceName}) {
package =
lib.nixvim.mkMaybeUnpackagedOption "plugins.none-ls.sources.${sourceType}.${sourceName}.package"
pkgs
sourceName
pkg;
};
}
# Only declare a package option if a package is required
// lib.optionalAttrs (packaged ? ${sourceName}) {
package =
lib.nixvim.mkMaybeUnpackagedOption "plugins.none-ls.sources.${sourceType}.${sourceName}.package"
pkgs
sourceName
pkg;
};
# TODO: Added 2024-07-16; remove after 24.11
imports =

View file

@ -4,14 +4,13 @@ let
mkSourcePlugin = import ./_mk-source-plugin.nix;
in
{
imports =
[
./prettier.nix
./prettierd.nix
]
++ (lib.flatten (
lib.mapAttrsToList (category: (lib.map (mkSourcePlugin category))) noneLsBuiltins
));
imports = [
./prettier.nix
./prettierd.nix
]
++ (lib.flatten (
lib.mapAttrsToList (category: (lib.map (mkSourcePlugin category))) noneLsBuiltins
));
config =
let

View file

@ -158,7 +158,8 @@ in
extra_opts = extraOpts;
};
};
} // cfg.extraOptions;
}
// cfg.extraOptions;
in
mkIf cfg.enable {
extraPlugins = [ cfg.package ];

View file

@ -1186,12 +1186,10 @@ in
nested = true;
});
extraConfigLua =
(optionalString autoOpenEnabled openNvimTreeFunction)
+ ''
extraConfigLua = (optionalString autoOpenEnabled openNvimTreeFunction) + ''
require('nvim-tree').setup(${lib.nixvim.toLuaObject setupOptions})
'';
require('nvim-tree').setup(${lib.nixvim.toLuaObject setupOptions})
'';
dependencies.git.enable = lib.mkDefault true;
};

View file

@ -207,7 +207,8 @@ in
reading_text = cfg.readingText;
workspace_text = cfg.workspaceText;
line_number_text = cfg.lineNumberText;
} // cfg.extraOptions;
}
// cfg.extraOptions;
in
mkIf cfg.enable {
extraPlugins = [ cfg.package ];

View file

@ -125,7 +125,8 @@ in
standalone file support
setting it to false may improve startup time
'';
} // import ../../lsp/language-servers/rust-analyzer-config.nix lib;
}
// import ../../lsp/language-servers/rust-analyzer-config.nix lib;
};
config = lib.mkIf cfg.enable {
extraPlugins = [
@ -174,7 +175,8 @@ in
inherit (cfg.server) standalone;
settings.rust-analyzer = lib.filterAttrs (n: v: n != "standalone") cfg.server;
};
} // cfg.extraOptions;
}
// cfg.extraOptions;
in
''
require('rust-tools').setup(${lib.nixvim.toLuaObject options})

View file

@ -331,7 +331,8 @@ in
folded_section = foldedSection;
};
inherit (cfg) parts;
} // sections;
}
// sections;
in
''
require('startup').setup(${lib.nixvim.toLuaObject setupOptions})

View file

@ -56,7 +56,8 @@ let
options = settingsOptions;
example = settingsExample;
};
} // extraOptions;
}
// extraOptions;
config = lib.mkIf cfg.enable (
lib.mkMerge [

View file

@ -33,7 +33,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
imports = [
# Register nvim-cmp association
{ cmpSourcePlugins.codeium = "windsurf-nvim"; }
] ++ (import ./deprecations.nix { inherit lib; }).imports;
]
++ (import ./deprecations.nix { inherit lib; }).imports;
settingsExample = {
enable_chat = true;