mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +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;
|
removeDependencies = ps: map (p: p // { plugin = removeAttrs p.plugin [ "dependencies" ]; }) ps;
|
||||||
|
|
||||||
# Separated start and opt plugins
|
# Separated start and opt plugins
|
||||||
partitionedPlugins = builtins.partition (p: p.optional) allPlugins;
|
partitionedOptStartPlugins = builtins.partition (p: p.optional) allPlugins;
|
||||||
startPlugins = partitionedPlugins.wrong;
|
startPlugins = partitionedOptStartPlugins.wrong;
|
||||||
# Remove opt plugin dependencies since they are already available in start plugins
|
# 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
|
# Test if plugin shouldn't be included in plugin pack
|
||||||
isStandalone =
|
isStandalone =
|
||||||
|
@ -114,25 +114,24 @@ in
|
||||||
|| builtins.elem (lib.getName p.plugin) config.performance.combinePlugins.standalonePlugins;
|
|| builtins.elem (lib.getName p.plugin) config.performance.combinePlugins.standalonePlugins;
|
||||||
|
|
||||||
# Separated standalone and combined start plugins
|
# Separated standalone and combined start plugins
|
||||||
partitionedStartPlugins = builtins.partition isStandalone startPlugins;
|
partitionedStandaloneStartPlugins = builtins.partition isStandalone startPlugins;
|
||||||
toCombinePlugins = partitionedStartPlugins.wrong;
|
toCombinePlugins = partitionedStandaloneStartPlugins.wrong;
|
||||||
# Remove standalone plugin dependencies since they are already available in start plugins
|
# 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
|
# Combine start plugins into a single pack
|
||||||
pluginPack =
|
pluginPack =
|
||||||
let
|
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 (
|
overriddenPlugins = map (
|
||||||
plugin:
|
plugin:
|
||||||
plugin.plugin.overrideAttrs (prev: {
|
plugin.plugin.overrideAttrs (prev: {
|
||||||
nativeBuildInputs = lib.remove pkgs.vimUtils.vimGenDocHook prev.nativeBuildInputs or [ ];
|
nativeBuildInputs = lib.remove pkgs.vimUtils.vimGenDocHook prev.nativeBuildInputs or [ ];
|
||||||
configurePhase = builtins.concatStringsSep "\n" (
|
configurePhase = ''
|
||||||
builtins.filter (s: s != ":") [
|
${prev.configurePhase or ""}
|
||||||
prev.configurePhase or ":"
|
rm -vf doc/tags'';
|
||||||
"rm -vf doc/tags"
|
|
||||||
]
|
|
||||||
);
|
|
||||||
})
|
})
|
||||||
) toCombinePlugins;
|
) toCombinePlugins;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue