mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +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};
|
cfg = config.${namespace}.${name};
|
||||||
|
|
||||||
# TODO support nested options!
|
globals =
|
||||||
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 =
|
|
||||||
if (hasAttr "settings" cfg) && (cfg.settings != null)
|
if (hasAttr "settings" cfg) && (cfg.settings != null)
|
||||||
then cfg.settings
|
then cfg.settings
|
||||||
else {};
|
else {};
|
||||||
globals = globalsFromOptions // globalsFromSettings;
|
|
||||||
|
|
||||||
# does this evaluate package?
|
# does this evaluate package?
|
||||||
packageOption =
|
packageOption =
|
||||||
|
@ -103,7 +83,6 @@ with lib; {
|
||||||
}
|
}
|
||||||
// settingsOption
|
// settingsOption
|
||||||
// packageOption
|
// packageOption
|
||||||
// pluginOptions
|
|
||||||
// extraOptions;
|
// extraOptions;
|
||||||
|
|
||||||
imports = let
|
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