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

View file

@ -133,14 +133,6 @@
}; };
outputs = inputs @ { self, nixpkgs, utils, ... }: outputs = inputs @ { self, nixpkgs, utils, ... }:
{
overlays = {
default = final: prev: {
myneovim = prev.callPackage ./. { };
};
};
} //
utils.lib.eachDefaultSystem (system:
let let
inputPlugins = [ inputPlugins = [
"plenary-nvim" "plenary-nvim"
@ -171,30 +163,34 @@
"theme" "theme"
]; ];
pkgs = import nixpkgs { mkNvimPlugins = { lib, vimUtils, vimPlugins, ... }:
inherit system;
overlays = [
(final: prev:
let let
inherit (prev.lib) listToAttrs nameValuePair; inherit (builtins) getAttr;
inherit (lib) listToAttrs nameValuePair;
buildPlugin = name: prev.vimUtils.buildVimPluginFrom2Nix { buildPlugin = name: vimUtils.buildVimPluginFrom2Nix {
name = name; name = name;
src = builtins.getAttr name inputs; src = getAttr name inputs;
}; };
buildPluginValuePair = n: nameValuePair n (buildPlugin n); buildPluginValuePair = n: nameValuePair n (buildPlugin n);
customPlugins = listToAttrs (builtins.map buildPluginValuePair inputPlugins); customPlugins = listToAttrs (map buildPluginValuePair inputPlugins);
in
{ vimPlugins = vimPlugins // customPlugins; };
in in
{ {
vimPlugins = prev.vimPlugins // customPlugins; overlays = {
} default = final: prev: {
) myneovim = prev.callPackage ./. (mkNvimPlugins prev);
];
}; };
};
} //
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
neovim = pkgs.callPackage ./. { }; neovim = pkgs.callPackage ./. (mkNvimPlugins pkgs);
in in
{ {
apps.default = { apps.default = {