Skip to content

Commit 0ac10f6

Browse files
stasjoktraxys
authored andcommitted
modules/performance: refactor after code review
1 parent 6e2ec5e commit 0ac10f6

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

modules/top-level/output.nix

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ in
102102
removeDependencies = ps: map (p: p // { plugin = removeAttrs p.plugin [ "dependencies" ]; }) ps;
103103

104104
# Separated start and opt plugins
105-
partitionedPlugins = builtins.partition (p: p.optional) allPlugins;
106-
startPlugins = partitionedPlugins.wrong;
105+
partitionedOptStartPlugins = builtins.partition (p: p.optional) allPlugins;
106+
startPlugins = partitionedOptStartPlugins.wrong;
107107
# Remove opt plugin dependencies since they are already available in start plugins
108-
optPlugins = removeDependencies partitionedPlugins.right;
108+
optPlugins = removeDependencies partitionedOptStartPlugins.right;
109109

110110
# Test if plugin shouldn't be included in plugin pack
111111
isStandalone =
@@ -114,25 +114,24 @@ in
114114
|| builtins.elem (lib.getName p.plugin) config.performance.combinePlugins.standalonePlugins;
115115

116116
# Separated standalone and combined start plugins
117-
partitionedStartPlugins = builtins.partition isStandalone startPlugins;
118-
toCombinePlugins = partitionedStartPlugins.wrong;
117+
partitionedStandaloneStartPlugins = builtins.partition isStandalone startPlugins;
118+
toCombinePlugins = partitionedStandaloneStartPlugins.wrong;
119119
# Remove standalone plugin dependencies since they are already available in start plugins
120-
standaloneStartPlugins = removeDependencies partitionedStartPlugins.right;
120+
standaloneStartPlugins = removeDependencies partitionedStandaloneStartPlugins.right;
121121

122122
# Combine start plugins into a single pack
123123
pluginPack =
124124
let
125-
# Plugins with doc tags removed
125+
# Every plugin has its own generated help tags (doc/tags)
126+
# Remove them to avoid collisions, new help tags
127+
# will be generate for the entire pack later on
126128
overriddenPlugins = map (
127129
plugin:
128130
plugin.plugin.overrideAttrs (prev: {
129131
nativeBuildInputs = lib.remove pkgs.vimUtils.vimGenDocHook prev.nativeBuildInputs or [ ];
130-
configurePhase = builtins.concatStringsSep "\n" (
131-
builtins.filter (s: s != ":") [
132-
prev.configurePhase or ":"
133-
"rm -vf doc/tags"
134-
]
135-
);
132+
configurePhase = ''
133+
${prev.configurePhase or ""}
134+
rm -vf doc/tags'';
136135
})
137136
) toCombinePlugins;
138137

0 commit comments

Comments
 (0)