diff --git a/modules/wrapper/build/config.nix b/modules/wrapper/build/config.nix index ee5b4fda..1faa2ccc 100644 --- a/modules/wrapper/build/config.nix +++ b/modules/wrapper/build/config.nix @@ -9,35 +9,30 @@ inherit (pkgs) vimPlugins; inherit (lib.strings) isString; inherit (lib.lists) filter map; - inherit (builtins) path; # alias to the internal configuration vimOptions = config.vim; - noBuildPlug = pname: let - input = inputs."plugin-${pname}"; - version = input.shortRev or input.shortDirtyRev or "dirty"; - in { - # vim.lazy.plugins relies on pname, so we only set that here - # version isn't needed for anything, but inherit it anyway for correctness - inherit pname version; - outPath = path { - name = "${pname}-0-unstable-${version}"; - path = input.outPath; - }; - passthru.vimPlugin = false; - }; + noBuildPlug = {pname, ...} @ attrs: let + src = inputs."plugin-${attrs.pname}"; + in + { + version = src.shortRev or src.shortDirtyRev or "dirty"; + outPath = src; + passthru.vimPlugin = false; + } + // attrs; # build a vim plugin with the given name and arguments # if the plugin is nvim-treesitter, warn the user to use buildTreesitterPlug # instead buildPlug = attrs: let - input = inputs."plugin-${attrs.pname}"; + src = inputs."plugin-${attrs.pname}"; in pkgs.vimUtils.buildVimPlugin ( { - version = input.shortRev or input.shortDirtyRev or "dirty"; - src = input.outPath; + version = src.shortRev or src.shortDirtyRev or "dirty"; + inherit src; } // attrs ); @@ -56,7 +51,7 @@ map ( plug: if (isString plug) - then pluginBuilders.${plug} or (noBuildPlug plug) + then pluginBuilders.${plug} or (noBuildPlug {pname = plug;}) else plug ) (filter (f: f != null) plugins);