vimPlugins: inherit lua & node packages before overrides (#390702)

authored by Austin Horstman and committed by GitHub 0f80da4f 0c41d9b6

+122 -100
+12 -5
pkgs/applications/editors/vim/plugins/default.nix
··· 24 24 inherit (neovimUtils) buildNeovimPlugin; 25 25 }; 26 26 27 + extras = callPackage ./extras.nix { 28 + inherit buildVimPlugin; 29 + inherit (neovimUtils) buildNeovimPlugin; 30 + }; 31 + 27 32 # TL;DR 28 33 # * Add your plugin to ./vim-plugin-names 29 34 # * run ./update.py ··· 36 41 }; 37 42 38 43 aliases = if config.allowAliases then (import ./aliases.nix lib) else final: prev: { }; 39 - 40 - extensible-self = lib.makeExtensible ( 41 - extends aliases (extends overrides (extends plugins initialPackages)) 42 - ); 43 44 in 44 - extensible-self 45 + lib.pipe initialPackages [ 46 + (extends plugins) 47 + (extends extras) 48 + (extends overrides) 49 + (extends aliases) 50 + lib.makeExtensible 51 + ]
+104
pkgs/applications/editors/vim/plugins/extras.nix
··· 1 + { 2 + lib, 3 + buildVimPlugin, 4 + buildNeovimPlugin, 5 + nodePackages, 6 + neovim-unwrapped, 7 + }: 8 + let 9 + luaPackages = neovim-unwrapped.lua.pkgs; 10 + in 11 + self: super: 12 + ( 13 + let 14 + nodePackageNames = [ 15 + "coc-cmake" 16 + "coc-docker" 17 + "coc-emmet" 18 + "coc-eslint" 19 + "coc-explorer" 20 + "coc-flutter" 21 + "coc-git" 22 + "coc-go" 23 + "coc-haxe" 24 + "coc-highlight" 25 + "coc-html" 26 + "coc-java" 27 + "coc-jest" 28 + "coc-json" 29 + "coc-lists" 30 + "coc-ltex" 31 + "coc-markdownlint" 32 + "coc-pairs" 33 + "coc-prettier" 34 + "coc-r-lsp" 35 + "coc-rls" 36 + "coc-rust-analyzer" 37 + "coc-sh" 38 + "coc-smartf" 39 + "coc-snippets" 40 + "coc-solargraph" 41 + "coc-spell-checker" 42 + "coc-sqlfluff" 43 + "coc-stylelint" 44 + "coc-sumneko-lua" 45 + "coc-tabnine" 46 + "coc-texlab" 47 + "coc-tsserver" 48 + "coc-ultisnips" 49 + "coc-vetur" 50 + "coc-vimlsp" 51 + "coc-vimtex" 52 + "coc-wxml" 53 + "coc-yaml" 54 + "coc-yank" 55 + ]; 56 + nodePackage2VimPackage = 57 + name: 58 + buildVimPlugin { 59 + pname = name; 60 + inherit (nodePackages.${name}) version meta; 61 + src = "${nodePackages.${name}}/lib/node_modules/${name}"; 62 + }; 63 + in 64 + lib.genAttrs nodePackageNames nodePackage2VimPackage 65 + ) 66 + // ( 67 + let 68 + luarocksPackageNames = [ 69 + "fidget-nvim" 70 + "gitsigns-nvim" 71 + "image-nvim" 72 + "lsp-progress-nvim" 73 + "lualine-nvim" 74 + "luasnip" 75 + "lush-nvim" 76 + "lz-n" 77 + "lze" 78 + "lzextras" 79 + "lzn-auto-require" 80 + "middleclass" 81 + "mini-test" 82 + "neorg" 83 + "neotest" 84 + "nui-nvim" 85 + "nvim-cmp" 86 + "nvim-nio" 87 + "nvim-web-devicons" 88 + "oil-nvim" 89 + "orgmode" 90 + "papis-nvim" 91 + "rest-nvim" 92 + "rocks-config-nvim" 93 + "rtp-nvim" 94 + "telescope-manix" 95 + "telescope-nvim" 96 + ]; 97 + toVimPackage = 98 + name: 99 + buildNeovimPlugin { 100 + luaAttr = luaPackages.${name}; 101 + }; 102 + in 103 + lib.genAttrs luarocksPackageNames toVimPackage 104 + )
+6 -95
pkgs/applications/editors/vim/plugins/overrides.nix
··· 1281 1281 dependencies = [ self.plenary-nvim ]; 1282 1282 }; 1283 1283 1284 + # NOTE: this overrides a luaPackages-based plugin 1284 1285 gitsigns-nvim = super.gitsigns-nvim.overrideAttrs { 1285 1286 dependencies = [ self.plenary-nvim ]; 1286 1287 }; ··· 1421 1422 doInstallCheck = true; 1422 1423 }; 1423 1424 1425 + # NOTE: this overrides a luaPackages-based plugin 1424 1426 image-nvim = super.image-nvim.overrideAttrs { 1425 1427 dependencies = with self; [ 1426 1428 nvim-treesitter ··· 1683 1685 dependencies = [ self.lualine-nvim ]; 1684 1686 }; 1685 1687 1688 + # NOTE: this overrides a luaPackages-based plugin 1686 1689 luasnip = super.luasnip.overrideAttrs { 1687 1690 dependencies = [ luaPackages.jsregexp ]; 1688 1691 }; ··· 1949 1952 ]; 1950 1953 }; 1951 1954 1955 + # NOTE: this overrides a luaPackages-based plugin 1952 1956 neotest = super.neotest.overrideAttrs { 1953 1957 dependencies = with self; [ 1954 1958 nvim-nio ··· 2838 2842 }; 2839 2843 2840 2844 # needs "http" and "json" treesitter grammars too 2845 + # NOTE: this overrides a luaPackages-based plugin 2841 2846 rest-nvim = super.rest-nvim.overrideAttrs { 2842 2847 dependencies = with self; [ 2843 2848 plenary-nvim ··· 3225 3230 dependencies = [ self.plenary-nvim ]; 3226 3231 }; 3227 3232 3233 + # NOTE: this overrides a luaPackages-based plugin 3228 3234 telescope-nvim = super.telescope-nvim.overrideAttrs { 3229 3235 dependencies = [ self.plenary-nvim ]; 3230 3236 }; ··· 3988 3994 ''; 3989 3995 3990 3996 }; 3991 - } 3992 - // ( 3993 - let 3994 - nodePackageNames = [ 3995 - "coc-cmake" 3996 - "coc-docker" 3997 - "coc-emmet" 3998 - "coc-eslint" 3999 - "coc-explorer" 4000 - "coc-flutter" 4001 - "coc-git" 4002 - "coc-go" 4003 - "coc-haxe" 4004 - "coc-highlight" 4005 - "coc-html" 4006 - "coc-java" 4007 - "coc-jest" 4008 - "coc-json" 4009 - "coc-lists" 4010 - "coc-ltex" 4011 - "coc-markdownlint" 4012 - "coc-pairs" 4013 - "coc-prettier" 4014 - "coc-r-lsp" 4015 - "coc-rls" 4016 - "coc-rust-analyzer" 4017 - "coc-sh" 4018 - "coc-smartf" 4019 - "coc-snippets" 4020 - "coc-solargraph" 4021 - "coc-spell-checker" 4022 - "coc-sqlfluff" 4023 - "coc-stylelint" 4024 - "coc-sumneko-lua" 4025 - "coc-tabnine" 4026 - "coc-texlab" 4027 - "coc-tsserver" 4028 - "coc-ultisnips" 4029 - "coc-vetur" 4030 - "coc-vimlsp" 4031 - "coc-vimtex" 4032 - "coc-wxml" 4033 - "coc-yaml" 4034 - "coc-yank" 4035 - ]; 4036 - nodePackage2VimPackage = 4037 - name: 4038 - buildVimPlugin { 4039 - pname = name; 4040 - inherit (nodePackages.${name}) version meta; 4041 - src = "${nodePackages.${name}}/lib/node_modules/${name}"; 4042 - }; 4043 - in 4044 - lib.genAttrs nodePackageNames nodePackage2VimPackage 4045 - ) 4046 - // ( 4047 - let 4048 - luarocksPackageNames = [ 4049 - "fidget-nvim" 4050 - "gitsigns-nvim" 4051 - "image-nvim" 4052 - "lsp-progress-nvim" 4053 - "lualine-nvim" 4054 - "luasnip" 4055 - "lush-nvim" 4056 - "lz-n" 4057 - "lze" 4058 - "lzextras" 4059 - "lzn-auto-require" 4060 - "middleclass" 4061 - "mini-test" 4062 - "neorg" 4063 - "neotest" 4064 - "nui-nvim" 4065 - "nvim-cmp" 4066 - "nvim-nio" 4067 - "nvim-web-devicons" 4068 - "oil-nvim" 4069 - "orgmode" 4070 - "papis-nvim" 4071 - "rest-nvim" 4072 - "rocks-config-nvim" 4073 - "rtp-nvim" 4074 - "telescope-manix" 4075 - "telescope-nvim" 4076 - ]; 4077 - toVimPackage = 4078 - name: 4079 - neovimUtils.buildNeovimPlugin { 4080 - luaAttr = luaPackages.${name}; 4081 - }; 4082 - in 4083 - lib.genAttrs luarocksPackageNames toVimPackage 4084 - ) 4085 - // { 4086 3997 4087 3998 rocks-nvim = 4088 3999 (neovimUtils.buildNeovimPlugin {