diff --git a/flake.nix b/flake.nix index 0e88b67..e66c18b 100644 --- a/flake.nix +++ b/flake.nix @@ -27,32 +27,32 @@ outputs = inputs @ { self, nixpkgs, utils, ... }: utils.lib.eachDefaultSystem (system: let + inputPlugins = [ + "tabby-nvim" + "editorconfig-nvim" + "telescope-live-grep-args-nvim" + "lspsaga-nvim" + ]; + pkgs = import nixpkgs { inherit system; overlays = [ - (f: p: { - vimPlugins = p.vimPlugins // { - # TODO: make util to build plugins from array - tabby-nvim = p.vimUtils.buildVimPluginFrom2Nix { - name = "tabby-nvim"; - src = inputs.tabby-nvim; - }; - editorconfig-nvim = p.vimUtils.buildVimPluginFrom2Nix { - name = "editorconfig-nvim"; - src = inputs.editorconfig-nvim; - }; - telescope-live-grep-args-nvim = p.vimUtils.buildVimPluginFrom2Nix { - name = "telescope-live-grep-args-nvim"; - src = inputs.telescope-live-grep-args-nvim; - }; - lspsaga-nvim = p.vimUtils.buildVimPluginFrom2Nix { - name = "lspsaga-nvim"; - src = inputs.lspsaga-nvim; - }; - }; - }) - ]; + (f: p: + let + inherit (p.lib) listToAttrs nameValuePair; + buildPlugin = name: p.vimUtils.buildVimPluginFrom2Nix { + name = name; + src = builtins.getAttr name inputs; + }; + + buildPluginValuePair = n: nameValuePair n (buildPlugin n); + + customPlugins = listToAttrs (builtins.map buildPluginValuePair inputPlugins); + in + { vimPlugins = p.vimPlugins // customPlugins; } + ) + ]; }; neovim = pkgs.callPackage ./. { };