7 # sanitizeDerivationName
8 normalizeName = lib.replaceStrings [ "." ] [ "-" ];
11 # function to create vim plugin from lua packages that are already packaged in
14 # the lua derivation to convert into a neovim plugin
15 luaAttr ? (lua.pkgs.${normalizeName attrs.pname})
19 originalLuaDrv = if (lib.typeOf luaAttr == "string") then
20 lib.warn "luaAttr as string is deprecated since September 2024. Pass a lua derivation directly ( e.g., `buildNeovimPlugin { luaAttr = lua.pkgs.plenary-nvim; }`)" lua.pkgs.${normalizeName luaAttr}
24 luaDrv = originalLuaDrv.overrideAttrs (oa: {
25 version = attrs.version or oa.version;
26 rockspecVersion = oa.rockspecVersion;
29 -- to create a flat hierarchy
30 lua_modules_path = "lua"
34 finalDrv = toVimPlugin (luaDrv.overrideAttrs(oa: attrs // {
35 nativeBuildInputs = oa.nativeBuildInputs or [] ++ [
36 lua.pkgs.luarocksMoveDataFolder
38 version = "${originalLuaDrv.version}-unstable-${oa.version}";