add nix2lua to passthru

This commit is contained in:
Dmitriy Pleshevskiy 2022-11-19 19:52:39 +03:00
parent 465f27ac0c
commit 4edf3f4d64
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
2 changed files with 18 additions and 9 deletions

View file

@ -12,14 +12,17 @@
, tree-sitter , tree-sitter
, neovimPlugins , neovimPlugins
, lib , lib
, toLua , nix2lua
, substituteAll , substituteAll
, ... , ...
}: }:
let let
inherit (builtins) catAttrs isFunction readFile; inherit (builtins) catAttrs isFunction readFile;
myLib = import ./lib.nix { inherit lib; } // { inherit substituteAll toLua; }; myLib = import ./lib.nix { inherit lib; } // {
inherit substituteAll;
inherit (nix2lua.lib) toLua;
};
pluginParams = neovimPlugins // { pluginParams = neovimPlugins // {
inherit plugins; inherit plugins;
@ -52,7 +55,7 @@ let
pluginConfigs = catAttrs "luaConfig" pluginsSettings; pluginConfigs = catAttrs "luaConfig" pluginsSettings;
allConfigs = basicConfigs ++ pluginConfigs; allConfigs = basicConfigs ++ pluginConfigs;
in in
wrapNeovim neovim-unwrapped { (wrapNeovim neovim-unwrapped {
inherit viAlias; inherit viAlias;
inherit vimAlias; inherit vimAlias;
@ -65,4 +68,8 @@ wrapNeovim neovim-unwrapped {
packages.myVimPackages = { start = allPlugins; }; packages.myVimPackages = { start = allPlugins; };
}; };
} }).overrideAttrs (oldAttrs: {
passthru = oldAttrs.passthru // {
nix2lua = nix2lua.lib;
};
})

View file

@ -216,13 +216,15 @@
neovimPlugins = (listToAttrs (map buildPluginValuePair inputPlugins)); neovimPlugins = (listToAttrs (map buildPluginValuePair inputPlugins));
in in
{ inherit neovimPlugins; }; {
inherit neovimPlugins;
inherit nix2lua;
};
in in
{ {
lib = nix2lua.lib;
overlays = { overlays = {
default = final: prev: { default = final: prev: {
myneovim = prev.callPackage self (mkNvimPlugins prev // nix2lua.lib); myneovim = prev.callPackage self (mkNvimPlugins prev);
}; };
}; };
} // } //
@ -230,14 +232,14 @@
let let
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
minimalNeovim = pkgs.callPackage self (mkNvimPlugins pkgs // nix2lua.lib); minimalNeovim = pkgs.callPackage self (mkNvimPlugins pkgs);
recommendedNeovim = (minimalNeovim.override { recommendedNeovim = (minimalNeovim.override {
enableDevIcons = true; enableDevIcons = true;
enableTabby = true; enableTabby = true;
grammarFileTypes = [ "nix" "lua" ]; grammarFileTypes = [ "nix" "lua" ];
plugins = with nix2lua.lib; { plugins = with minimalNeovim.nix2lua; {
nvimTree.settings = { nvimTree.settings = {
open_on_setup = true; open_on_setup = true;
renderer = { renderer = {