nix: build plugins from input list
This commit is contained in:
parent
2d1b7d554f
commit
dc5d872e0b
1 changed files with 22 additions and 22 deletions
44
flake.nix
44
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 ./. { };
|
||||
|
|
Reference in a new issue