nix: fix plugins for the overlays

This commit is contained in:
Dmitriy Pleshevskiy 2022-09-24 23:46:15 +03:00
parent 96df527d73
commit d6a70d64ea
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215

102
flake.nix
View file

@ -133,68 +133,64 @@
};
outputs = inputs @ { self, nixpkgs, utils, ... }:
let
inputPlugins = [
"plenary-nvim"
# config
"editorconfig-nvim"
# explorer
"nvim-tree-lua"
"telescope-nvim"
"telescope-live-grep-args-nvim"
# formatter
"neoformat"
# git
"gitsigns-nvim"
# lsp
"nvim-lspconfig"
"lspsaga-nvim"
"luaship"
"nvim-cmp"
"cmp-nvim-lsp"
"cmp-luasnip"
# syntax
"nvim-treesitter"
# theme
"tabby-nvim"
"lualine-nvim"
"lualine-lsp-progress"
"nvim-web-devicons"
"theme"
];
mkNvimPlugins = { lib, vimUtils, vimPlugins, ... }:
let
inherit (builtins) getAttr;
inherit (lib) listToAttrs nameValuePair;
buildPlugin = name: vimUtils.buildVimPluginFrom2Nix {
name = name;
src = getAttr name inputs;
};
buildPluginValuePair = n: nameValuePair n (buildPlugin n);
customPlugins = listToAttrs (map buildPluginValuePair inputPlugins);
in
{ vimPlugins = vimPlugins // customPlugins; };
in
{
overlays = {
default = final: prev: {
myneovim = prev.callPackage ./. { };
myneovim = prev.callPackage ./. (mkNvimPlugins prev);
};
};
} //
utils.lib.eachDefaultSystem (system:
let
inputPlugins = [
"plenary-nvim"
# config
"editorconfig-nvim"
# explorer
"nvim-tree-lua"
"telescope-nvim"
"telescope-live-grep-args-nvim"
# formatter
"neoformat"
# git
"gitsigns-nvim"
# lsp
"nvim-lspconfig"
"lspsaga-nvim"
"luaship"
"nvim-cmp"
"cmp-nvim-lsp"
"cmp-luasnip"
# syntax
"nvim-treesitter"
# theme
"tabby-nvim"
"lualine-nvim"
"lualine-lsp-progress"
"nvim-web-devicons"
"theme"
];
pkgs = import nixpkgs { inherit system; };
pkgs = import nixpkgs {
inherit system;
overlays = [
(final: prev:
let
inherit (prev.lib) listToAttrs nameValuePair;
buildPlugin = name: prev.vimUtils.buildVimPluginFrom2Nix {
name = name;
src = builtins.getAttr name inputs;
};
buildPluginValuePair = n: nameValuePair n (buildPlugin n);
customPlugins = listToAttrs (builtins.map buildPluginValuePair inputPlugins);
in
{
vimPlugins = prev.vimPlugins // customPlugins;
}
)
];
};
neovim = pkgs.callPackage ./. { };
neovim = pkgs.callPackage ./. (mkNvimPlugins pkgs);
in
{
apps.default = {