From 448bb9bbaecd27e90e3a20b761736db25c939e87 Mon Sep 17 00:00:00 2001 From: ilkecan Date: Thu, 29 Sep 2022 15:59:07 +0000 Subject: [PATCH] vimUtils.buildVimPlugin: prevent building twice Don't set the `rtp` attribute using `overrideAttrs`. `overrideAttrs` passes the attribute to the builder hence creates a different derivation. This made vim plugins being built twice. --- .../editors/vim/plugins/build-vim-plugin.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/vim/plugins/build-vim-plugin.nix b/pkgs/applications/editors/vim/plugins/build-vim-plugin.nix index 9e7bb1be2d5c..bf54e8a5e0ac 100644 --- a/pkgs/applications/editors/vim/plugins/build-vim-plugin.nix +++ b/pkgs/applications/editors/vim/plugins/build-vim-plugin.nix @@ -8,6 +8,12 @@ }: rec { + addRtp = drv: + drv // { + rtp = "${drv}"; + overrideAttrs = f: addRtp (drv.overrideAttrs f); + }; + buildVimPlugin = attrs@{ name ? "${attrs.pname}-${attrs.version}", namePrefix ? "vimplugin-", @@ -36,9 +42,7 @@ rec { runHook postInstall ''; }); - in toVimPlugin(drv.overrideAttrs(oa: { - rtp = "${drv}"; - })); + in addRtp drv; buildVimPluginFrom2Nix = attrs: buildVimPlugin ({ # vim plugins may override this