1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-08 11:36:07 +01:00

plugins/package-info: remove explicit option declarations from settingsOptions

This commit is contained in:
Gaetan Lepage 2025-10-01 00:17:38 +02:00 committed by Gaétan Lepage
parent 94331cc50d
commit f0cd7d4fb3
2 changed files with 22 additions and 78 deletions

View file

@ -4,9 +4,6 @@
config,
...
}:
let
inherit (lib.nixvim) defaultNullOpts;
in
lib.nixvim.plugins.mkNeovimPlugin {
name = "package-info";
package = "package-info-nvim";
@ -14,81 +11,13 @@ lib.nixvim.plugins.mkNeovimPlugin {
maintainers = [ lib.maintainers.khaneliman ];
settingsOptions = {
autostart = defaultNullOpts.mkBool true ''
Whether to autostart when `package.json` is opened.
'';
hide_up_to_date = defaultNullOpts.mkBool false ''
It hides up to date versions when displaying virtual text.
'';
hide_unstable_versions = defaultNullOpts.mkBool false ''
It hides unstable versions from version list e.g `next-11.1.3-canary3`.
'';
package_manager = defaultNullOpts.mkStr "npm" ''
Can be `npm`, `yarn`, or `pnpm`.
The plugin will try to auto-detect the package manager based on
`yarn.lock` or `package-lock.json`.
If none are found it will use the provided one, if nothing is provided it will use `npm`
'';
colors =
defaultNullOpts.mkNullableWithRaw
(
with lib.types;
submodule {
freeformType = with types; attrsOf anything;
options = {
up_to_date = defaultNullOpts.mkStr "#3C4048" ''
Text color for up to date dependency virtual text.
'';
outdated = defaultNullOpts.mkStr "#d19a66" ''
Text color for outdated dependency virtual text.
'';
invalid = defaultNullOpts.mkStr "#ee4b2b" ''
Text color for invalid dependency virtual text.
'';
};
}
)
{
up_to_date = "#3C4048";
outdated = "#d19a66";
invalid = "#ee4b2b";
}
"Colors of virtual text.";
icons =
defaultNullOpts.mkNullableWithRaw
(
with lib.types;
either anything (submodule {
freeformType = with types; attrsOf anything;
options = {
enable = defaultNullOpts.mkBool true ''
Whether to display icons.
'';
style = defaultNullOpts.mkAttrsOf anything {
up_to_date = "| ";
outdated = "| ";
invalid = "| ";
} "Icons for different dependency states.";
};
})
)
{
enable = true;
style = {
up_to_date = "| ";
outdated = "| ";
invalid = "| ";
};
}
"Icons for virtual text.";
settingsExample = {
icons.style = {
up_to_date = "| ";
outdated = "| ";
};
hide_up_to_date = true;
package_manager = "npm";
};
extraOptions = {

View file

@ -29,6 +29,21 @@
};
};
example = {
plugins.package-info = {
enable = true;
settings = {
icons.style = {
up_to_date = "| ";
outdated = "| ";
};
hide_up_to_date = true;
package_manager = "npm";
};
};
};
with-telescope = {
plugins = {
telescope.enable = true;