mirror of
https://github.com/nix-community/nixvim.git
synced 2025-11-24 19:29:41 +01:00
modules/performance: add excludedPlugins option to byte compilation
Signed-off-by: saygo-png <saygo.mail@proton.me>
This commit is contained in:
parent
43c6f7293e
commit
cd427977f3
3 changed files with 27 additions and 3 deletions
|
|
@ -4,15 +4,25 @@
|
|||
Inputs: List of normalized plugins
|
||||
Outputs: List of normalized (compiled) plugins
|
||||
*/
|
||||
{ lib, pkgs }:
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
excludedPlugins,
|
||||
}:
|
||||
normalizedPlugins:
|
||||
let
|
||||
builders = lib.nixvim.builders.withPkgs pkgs;
|
||||
inherit (import ./utils.nix lib) mapNormalizedPlugins;
|
||||
|
||||
excludedNames = map (p: if builtins.isString p then p else lib.getName p) excludedPlugins;
|
||||
isExcluded = p: builtins.elem (lib.getName p.plugin) excludedNames;
|
||||
|
||||
partitionedPlugins = builtins.partition isExcluded normalizedPlugins;
|
||||
|
||||
byteCompile =
|
||||
p:
|
||||
(builders.byteCompileLuaDrv p).overrideAttrs (
|
||||
prev: lib.optionalAttrs (prev ? dependencies) { dependencies = map byteCompile prev.dependencies; }
|
||||
);
|
||||
in
|
||||
mapNormalizedPlugins byteCompile
|
||||
(mapNormalizedPlugins byteCompile partitionedPlugins.wrong) ++ partitionedPlugins.right
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue