mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 16:39:00 +02:00
helpers/vim-plugin/mkVimPlugin: remove deprecated mkDefaultOpt code
This commit is contained in:
parent
1b12471be1
commit
db33f46b5d
1 changed files with 1 additions and 38 deletions
|
@ -36,30 +36,10 @@ with lib; {
|
|||
|
||||
cfg = config.${namespace}.${name};
|
||||
|
||||
# TODO support nested options!
|
||||
pluginOptions =
|
||||
mapAttrs
|
||||
(
|
||||
optName: opt:
|
||||
opt.option
|
||||
)
|
||||
options;
|
||||
|
||||
globalsFromOptions =
|
||||
mapAttrs'
|
||||
(optName: opt: {
|
||||
name =
|
||||
if opt.global == null
|
||||
then optName
|
||||
else opt.global;
|
||||
value = cfg.${optName};
|
||||
})
|
||||
options;
|
||||
globalsFromSettings =
|
||||
globals =
|
||||
if (hasAttr "settings" cfg) && (cfg.settings != null)
|
||||
then cfg.settings
|
||||
else {};
|
||||
globals = globalsFromOptions // globalsFromSettings;
|
||||
|
||||
# does this evaluate package?
|
||||
packageOption =
|
||||
|
@ -103,7 +83,6 @@ with lib; {
|
|||
}
|
||||
// settingsOption
|
||||
// packageOption
|
||||
// pluginOptions
|
||||
// extraOptions;
|
||||
|
||||
imports = let
|
||||
|
@ -157,20 +136,4 @@ with lib; {
|
|||
]
|
||||
);
|
||||
};
|
||||
|
||||
mkDefaultOpt = {
|
||||
type,
|
||||
global ? null,
|
||||
description ? null,
|
||||
example ? null,
|
||||
default ? null,
|
||||
...
|
||||
}: {
|
||||
option = mkOption {
|
||||
type = types.nullOr type;
|
||||
inherit default description example;
|
||||
};
|
||||
|
||||
inherit global;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue