helpers/vim-plugin/mkVimPlugin: remove deprecated mkDefaultOpt code

This commit is contained in:
Gaetan Lepage 2024-03-12 20:46:04 +01:00 committed by Gaétan Lepage
parent 1b12471be1
commit db33f46b5d

View file

@ -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;
};
}