some cleanup
This commit is contained in:
parent
54333ac0a6
commit
3717b5002d
3 changed files with 9 additions and 11 deletions
|
@ -204,7 +204,7 @@
|
|||
patches = lib.optional
|
||||
(pathExists ./patches/${name})
|
||||
(map
|
||||
(fn: ./patches/${name}/${fn})
|
||||
(patchName: ./patches/${name}/${patchName})
|
||||
(attrNames (readDir ./patches/${name}))
|
||||
);
|
||||
};
|
||||
|
|
13
neovim.nix
13
neovim.nix
|
@ -9,34 +9,31 @@
|
|||
, theme ? { }
|
||||
, plugins ? { }
|
||||
, wrapNeovim
|
||||
, runCommand
|
||||
, neovim-unwrapped
|
||||
, tree-sitter
|
||||
, neovimPlugins
|
||||
, lib
|
||||
, nix2lua
|
||||
, substituteAll
|
||||
, fetchFromGitHub
|
||||
, fetchFromGitea
|
||||
, callPackage
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (builtins) catAttrs isFunction readFile;
|
||||
inherit (builtins) catAttrs readFile;
|
||||
|
||||
myLib = import ./lib.nix { inherit lib; } // {
|
||||
inherit substituteAll;
|
||||
inherit (nix2lua.lib) toLua mkLuaNil;
|
||||
};
|
||||
|
||||
pluginParams = neovimPlugins // {
|
||||
inherit runCommand tree-sitter fetchFromGitHub fetchFromGitea;
|
||||
inherit plugins enableDevIcons enableTabby enableOrgMode;
|
||||
inherit tree-sitter plugins enableDevIcons enableTabby enableOrgMode;
|
||||
themeCfg = theme;
|
||||
lib = myLib;
|
||||
};
|
||||
|
||||
callPlugin = op:
|
||||
if isFunction op then op pluginParams else import op pluginParams;
|
||||
callPlugin = plugin: callPackage plugin pluginParams;
|
||||
callPlugins = list: map callPlugin list;
|
||||
|
||||
pluginsSettings = callPlugins [
|
||||
|
|
|
@ -13,8 +13,9 @@ let
|
|||
|
||||
hopLuaConfig = readFile ./hop-nvim.lua;
|
||||
|
||||
orgmodeEnable = lib.attrByPath [ "orgmode" "enable" ] enableOrgMode plugins;
|
||||
orgmodeSettings = lib.toLua (lib.attrByPath [ "orgmode" "settings" ] { } plugins);
|
||||
orgmodeLuaConfig = lib.optional enableOrgMode (readFile (lib.substituteAll { src = ./nvim-orgmode.lua; inherit orgmodeSettings; }));
|
||||
orgmodeLuaConfig = lib.optional orgmodeEnable (readFile (lib.substituteAll { src = ./nvim-orgmode.lua; inherit orgmodeSettings; }));
|
||||
|
||||
colorizerFiletypes = lib.toLua (lib.attrByPath [ "colorizer" "filetypes" ] lib.mkLuaNil plugins);
|
||||
colorizerSettings = lib.toLua (lib.attrByPath [ "colorizer" "settings" ] lib.mkLuaNil plugins);
|
||||
|
@ -24,5 +25,5 @@ in
|
|||
luaConfig = hopLuaConfig + orgmodeLuaConfig + colorizerLuaConfig;
|
||||
|
||||
plugins = [ hop-nvim nvim-colorizer ]
|
||||
++ lib.optional enableOrgMode [ nvim-orgmode org-bullets-nvim ];
|
||||
++ lib.optional orgmodeEnable [ nvim-orgmode org-bullets-nvim ];
|
||||
}
|
||||
|
|
Reference in a new issue