mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 17:58:38 +02:00
lib/{vim,neovim}-plugin: installPackage
-> packageDecorator
Replace `mkNeovimPlugin`'s `installPackage` parameter with a new internal module option: `packageDecorator`. The option is a function that applies some transformation to `cfg.package`'s value before it is installed.
This commit is contained in:
parent
1d78aee791
commit
de99f2938f
3 changed files with 30 additions and 10 deletions
|
@ -50,7 +50,6 @@
|
|||
extraPlugins ? [ ],
|
||||
extraPackages ? [ ],
|
||||
callSetup ? true,
|
||||
installPackage ? true,
|
||||
}@args:
|
||||
let
|
||||
namespace = if isColorscheme then "colorschemes" else "plugins";
|
||||
|
@ -104,6 +103,16 @@
|
|||
package
|
||||
];
|
||||
};
|
||||
packageDecorator = lib.mkOption {
|
||||
type = lib.types.functionTo lib.types.package;
|
||||
default = lib.id;
|
||||
defaultText = lib.literalExpression "x: x";
|
||||
description = ''
|
||||
Additional transformations to apply to the final installed package.
|
||||
The result of these transformations is **not** visible in the `package` option's value.
|
||||
'';
|
||||
internal = true;
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs hasSettings {
|
||||
settings = lib.nixvim.mkSettingsOption {
|
||||
|
@ -129,8 +138,10 @@
|
|||
lib.mkMerge (
|
||||
[
|
||||
{
|
||||
extraPlugins = (lib.optional installPackage cfg.package) ++ extraPlugins;
|
||||
inherit extraPackages;
|
||||
extraPlugins = extraPlugins ++ [
|
||||
(cfg.packageDecorator cfg.package)
|
||||
];
|
||||
}
|
||||
(lib.optionalAttrs (isColorscheme && (colorscheme != null)) {
|
||||
colorscheme = lib.mkDefault colorscheme;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue