mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
modules/performance: refactor after code review
This commit is contained in:
parent
6e2ec5ed02
commit
0ac10f6776
1 changed files with 12 additions and 13 deletions
|
@ -102,10 +102,10 @@ in
|
|||
removeDependencies = ps: map (p: p // { plugin = removeAttrs p.plugin [ "dependencies" ]; }) ps;
|
||||
|
||||
# Separated start and opt plugins
|
||||
partitionedPlugins = builtins.partition (p: p.optional) allPlugins;
|
||||
startPlugins = partitionedPlugins.wrong;
|
||||
partitionedOptStartPlugins = builtins.partition (p: p.optional) allPlugins;
|
||||
startPlugins = partitionedOptStartPlugins.wrong;
|
||||
# Remove opt plugin dependencies since they are already available in start plugins
|
||||
optPlugins = removeDependencies partitionedPlugins.right;
|
||||
optPlugins = removeDependencies partitionedOptStartPlugins.right;
|
||||
|
||||
# Test if plugin shouldn't be included in plugin pack
|
||||
isStandalone =
|
||||
|
@ -114,25 +114,24 @@ in
|
|||
|| builtins.elem (lib.getName p.plugin) config.performance.combinePlugins.standalonePlugins;
|
||||
|
||||
# Separated standalone and combined start plugins
|
||||
partitionedStartPlugins = builtins.partition isStandalone startPlugins;
|
||||
toCombinePlugins = partitionedStartPlugins.wrong;
|
||||
partitionedStandaloneStartPlugins = builtins.partition isStandalone startPlugins;
|
||||
toCombinePlugins = partitionedStandaloneStartPlugins.wrong;
|
||||
# Remove standalone plugin dependencies since they are already available in start plugins
|
||||
standaloneStartPlugins = removeDependencies partitionedStartPlugins.right;
|
||||
standaloneStartPlugins = removeDependencies partitionedStandaloneStartPlugins.right;
|
||||
|
||||
# Combine start plugins into a single pack
|
||||
pluginPack =
|
||||
let
|
||||
# Plugins with doc tags removed
|
||||
# Every plugin has its own generated help tags (doc/tags)
|
||||
# Remove them to avoid collisions, new help tags
|
||||
# will be generate for the entire pack later on
|
||||
overriddenPlugins = map (
|
||||
plugin:
|
||||
plugin.plugin.overrideAttrs (prev: {
|
||||
nativeBuildInputs = lib.remove pkgs.vimUtils.vimGenDocHook prev.nativeBuildInputs or [ ];
|
||||
configurePhase = builtins.concatStringsSep "\n" (
|
||||
builtins.filter (s: s != ":") [
|
||||
prev.configurePhase or ":"
|
||||
"rm -vf doc/tags"
|
||||
]
|
||||
);
|
||||
configurePhase = ''
|
||||
${prev.configurePhase or ""}
|
||||
rm -vf doc/tags'';
|
||||
})
|
||||
) toCombinePlugins;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue