some cleanup

This commit is contained in:
Dmitriy Pleshevskiy 2023-05-23 00:19:13 +03:00
parent 54333ac0a6
commit 3717b5002d
Signed by: pleshevskiy
GPG key ID: 79C4487B44403985
3 changed files with 9 additions and 11 deletions

View file

@ -204,7 +204,7 @@
patches = lib.optional
(pathExists ./patches/${name})
(map
(fn: ./patches/${name}/${fn})
(patchName: ./patches/${name}/${patchName})
(attrNames (readDir ./patches/${name}))
);
};

View file

@ -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 [

View file

@ -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 ];
}