mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-10 07:25:30 +00:00
Utilized lib.optionalAttrs to simplify code
This commit is contained in:
parent
c3c720f4a2
commit
c440ba5826
1 changed files with 42 additions and 57 deletions
|
|
@ -5,6 +5,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (builtins) isString map;
|
||||
inherit (lib) optionalAttrs;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.config) mkBool;
|
||||
inherit (lib.options) mkOption mkPackageOption;
|
||||
|
|
@ -529,9 +530,7 @@ in {
|
|||
}
|
||||
#
|
||||
# -- Build --
|
||||
// (
|
||||
if cfg.build.enable
|
||||
then {
|
||||
// (optionalAttrs cfg.build.enable {
|
||||
build = {
|
||||
inherit
|
||||
(cfg.build)
|
||||
|
|
@ -546,37 +545,25 @@ in {
|
|||
inherit (builderCfg) args;
|
||||
executable = "${builderCfg.package}/bin/${builderCfg.executable}";
|
||||
};
|
||||
}
|
||||
else {}
|
||||
)
|
||||
})
|
||||
#
|
||||
# -- Chktex --
|
||||
// (
|
||||
if texlabCfg.chktex.enable
|
||||
then {
|
||||
// (optionalAttrs texlabCfg.chktex.enable {
|
||||
chktex = {
|
||||
inherit (texlabCfg.chktex) onOpenAndSave onEdit additionalArgs;
|
||||
};
|
||||
}
|
||||
else {}
|
||||
)
|
||||
})
|
||||
#
|
||||
# -- Forward Search --
|
||||
// (
|
||||
if texlabCfg.forwardSearch.enable
|
||||
then {
|
||||
// (optionalAttrs texlabCfg.forwardSearch.enable {
|
||||
forwardSearch = {
|
||||
inherit (texlabCfg.forwardSearch) args;
|
||||
executable = "${texlabCfg.forwardSearch.package}/bin/${texlabCfg.forwardSearch.executable}";
|
||||
};
|
||||
}
|
||||
else {}
|
||||
)
|
||||
})
|
||||
#
|
||||
# -- Symbols --
|
||||
// (
|
||||
if texlabCfg.symbols.enable
|
||||
then {
|
||||
// (optionalAttrs texlabCfg.symbols.enable {
|
||||
symbols = {
|
||||
inherit (texlabCfg.symbols) allowedPatterns ignoredPatterns;
|
||||
|
||||
|
|
@ -590,9 +577,7 @@ in {
|
|||
})
|
||||
texlabCfg.symbols.customEnvironments;
|
||||
};
|
||||
}
|
||||
else {}
|
||||
)
|
||||
})
|
||||
#
|
||||
# -- Extra Settings --
|
||||
// texlabCfg.extraLuaSettings
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue