From 6c852858908bac1f087d7ac66fd8e9bc839a9d19 Mon Sep 17 00:00:00 2001 From: Stanislav Asunkin <1353637+stasjok@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:08:05 +0300 Subject: [PATCH] modules/performance: refactor after code review --- modules/top-level/output.nix | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/modules/top-level/output.nix b/modules/top-level/output.nix index efa9dcc2d2..07f7778a99 100644 --- a/modules/top-level/output.nix +++ b/modules/top-level/output.nix @@ -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;