diff --git a/modules/autocmd.nix b/modules/autocmd.nix index ba167d2518..ceea3d6e99 100644 --- a/modules/autocmd.nix +++ b/modules/autocmd.nix @@ -1,11 +1,10 @@ { - config, lib, + helpers, + config, ... }: with lib; let - helpers = import ../lib/helpers.nix {inherit lib;}; - autoGroupOption = types.submodule { options = { clear = mkOption { diff --git a/modules/clipboard.nix b/modules/clipboard.nix index 27c8b815d2..685c5125b4 100644 --- a/modules/clipboard.nix +++ b/modules/clipboard.nix @@ -1,6 +1,6 @@ { - config, lib, + config, pkgs, ... }: diff --git a/modules/commands.nix b/modules/commands.nix index 241ab25d5f..561f56727a 100644 --- a/modules/commands.nix +++ b/modules/commands.nix @@ -1,10 +1,10 @@ { - config, lib, + helpers, + config, ... }: with lib; let - helpers = import ../lib/helpers.nix {inherit lib;}; commandAttributes = types.submodule { options = { command = mkOption { diff --git a/modules/filetype.nix b/modules/filetype.nix index 28e4b0610e..5d6c30217b 100644 --- a/modules/filetype.nix +++ b/modules/filetype.nix @@ -1,10 +1,10 @@ { - config, lib, + helpers, + config, ... -} @ args: +}: with lib; let - helpers = import ../lib/helpers.nix args; filetypeDefinition = helpers.mkNullOrOption (types.attrsOf ( types.oneOf [ # Raw filetype diff --git a/modules/highlights.nix b/modules/highlights.nix index ab80d68f4f..b3d4cb3f98 100644 --- a/modules/highlights.nix +++ b/modules/highlights.nix @@ -1,58 +1,57 @@ { - config, lib, + helpers, + config, ... -}: let - helpers = import ../lib/helpers.nix {inherit lib;}; -in - with lib; { - options = { - highlight = mkOption { - type = types.attrsOf helpers.highlightType; - default = {}; - description = "Define highlight groups"; - example = '' - highlight = { - Comment.fg = '#ff0000'; - }; - ''; - }; +}: +with lib; { + options = { + highlight = mkOption { + type = types.attrsOf helpers.highlightType; + default = {}; + description = "Define highlight groups"; + example = '' + highlight = { + Comment.fg = '#ff0000'; + }; + ''; + }; - match = mkOption { - type = types.attrsOf types.str; - default = {}; - description = "Define match groups"; - example = '' - match = { - ExtraWhitespace = '\\s\\+$'; - }; - ''; - }; + match = mkOption { + type = types.attrsOf types.str; + default = {}; + description = "Define match groups"; + example = '' + match = { + ExtraWhitespace = '\\s\\+$'; + }; + ''; }; + }; + + config = mkIf (config.highlight != {} || config.match != {}) { + extraConfigLuaPost = + (optionalString (config.highlight != {}) '' + -- Highlight groups {{ + do + local highlights = ${helpers.toLuaObject config.highlight} - config = mkIf (config.highlight != {} || config.match != {}) { - extraConfigLuaPost = - (optionalString (config.highlight != {}) '' - -- Highlight groups {{ + for k,v in pairs(highlights) do + vim.api.nvim_set_hl(0, k, v) + end + end + -- }} + '') + + (optionalString (config.match != {}) '' + -- Match groups {{ do - local highlights = ${helpers.toLuaObject config.highlight} + local match = ${helpers.toLuaObject config.match} - for k,v in pairs(highlights) do - vim.api.nvim_set_hl(0, k, v) + for k,v in pairs(match) do + vim.fn.matchadd(k, v) end end -- }} - '') - + (optionalString (config.match != {}) '' - -- Match groups {{ - do - local match = ${helpers.toLuaObject config.match} - - for k,v in pairs(match) do - vim.fn.matchadd(k, v) - end - end - -- }} - ''); - }; - } + ''); + }; +} diff --git a/modules/keymaps.nix b/modules/keymaps.nix index 034f821e25..4a895c08cb 100644 --- a/modules/keymaps.nix +++ b/modules/keymaps.nix @@ -1,11 +1,10 @@ { - config, lib, + helpers, + config, ... }: -with lib; let - helpers = import ../lib/helpers.nix {inherit lib;}; -in { +with lib; { options = { maps = mapAttrs diff --git a/modules/lua-loader.nix b/modules/lua-loader.nix index 26054d5b01..c07b775930 100644 --- a/modules/lua-loader.nix +++ b/modules/lua-loader.nix @@ -1,6 +1,6 @@ { - config, lib, + config, ... }: with lib; let diff --git a/modules/options.nix b/modules/options.nix index f99d072767..6149eb49b7 100644 --- a/modules/options.nix +++ b/modules/options.nix @@ -1,11 +1,10 @@ { - config, lib, + helpers, + config, ... }: -with lib; let - helpers = import ../lib/helpers.nix {inherit lib;}; -in { +with lib; { options = { options = mkOption { type = types.attrsOf types.anything; diff --git a/modules/output.nix b/modules/output.nix index 866d80ec05..fbc115c3ed 100644 --- a/modules/output.nix +++ b/modules/output.nix @@ -1,7 +1,6 @@ { - pkgs, - config, lib, + config, ... }: with lib; let diff --git a/plugins/bufferlines/barbar.nix b/plugins/bufferlines/barbar.nix index f23ddbcbee..c6951ddb93 100644 --- a/plugins/bufferlines/barbar.nix +++ b/plugins/bufferlines/barbar.nix @@ -1,12 +1,12 @@ { lib, - pkgs, + helpers, config, + pkgs, ... }: with lib; let cfg = config.plugins.barbar; - helpers = import ../helpers.nix {inherit lib;}; bufferOptions = { bufferIndex = helpers.mkNullOrOption types.bool '' diff --git a/plugins/bufferlines/barbecue.nix b/plugins/bufferlines/barbecue.nix index 99f11ac2db..0e535381a1 100644 --- a/plugins/bufferlines/barbecue.nix +++ b/plugins/bufferlines/barbecue.nix @@ -1,12 +1,12 @@ { lib, - pkgs, + helpers, config, + pkgs, ... }: with lib; let cfg = config.plugins.barbecue; - helpers = import ../helpers.nix {inherit lib;}; mkListStr = helpers.defaultNullOpts.mkNullable (types.listOf types.str); in { options.plugins.barbecue = diff --git a/plugins/bufferlines/bufferline.nix b/plugins/bufferlines/bufferline.nix index be4315072d..b2e2de34a2 100644 --- a/plugins/bufferlines/bufferline.nix +++ b/plugins/bufferlines/bufferline.nix @@ -1,12 +1,12 @@ { + lib, + helpers, config, pkgs, - lib, ... -} @ args: +}: with lib; let cfg = config.plugins.bufferline; - helpers = import ../helpers.nix args; highlightOption = { fg = helpers.mkNullOrOption types.str "foreground color"; diff --git a/plugins/bufferlines/navic.nix b/plugins/bufferlines/navic.nix index 0d187c54f7..d241ebeb12 100644 --- a/plugins/bufferlines/navic.nix +++ b/plugins/bufferlines/navic.nix @@ -1,13 +1,12 @@ { lib, - pkgs, + helpers, config, + pkgs, ... }: with lib; let cfg = config.plugins.navic; - helpers = import ../helpers.nix {inherit lib;}; - mkListStr = helpers.defaultNullOpts.mkNullable (types.listOf types.str); in { options.plugins.navic = helpers.extraOptionsOptions diff --git a/plugins/colorschemes/ayu.nix b/plugins/colorschemes/ayu.nix index 0b035ed7d0..8b95c04d72 100644 --- a/plugins/colorschemes/ayu.nix +++ b/plugins/colorschemes/ayu.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... -} @ args: +}: with lib; let cfg = config.colorschemes.ayu; - helpers = import ../helpers.nix args; in { options = { colorschemes.ayu = diff --git a/plugins/colorschemes/base16.nix b/plugins/colorschemes/base16.nix index daa47d4dfc..0a4816ea64 100644 --- a/plugins/colorschemes/base16.nix +++ b/plugins/colorschemes/base16.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.colorschemes.base16; - helpers = import ../helpers.nix {inherit lib;}; themes = import ./base16-list.nix; in { options = { diff --git a/plugins/colorschemes/catppuccin.nix b/plugins/colorschemes/catppuccin.nix index d59bea95ce..fdd94b5dfc 100644 --- a/plugins/colorschemes/catppuccin.nix +++ b/plugins/colorschemes/catppuccin.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... -} @ args: +}: with lib; let cfg = config.colorschemes.catppuccin; - helpers = import ../helpers.nix args; flavours = [ "latte" diff --git a/plugins/colorschemes/dracula.nix b/plugins/colorschemes/dracula.nix index 95cd2e3aee..d0cfcee397 100644 --- a/plugins/colorschemes/dracula.nix +++ b/plugins/colorschemes/dracula.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.colorschemes.dracula; - helpers = import ../helpers.nix {inherit lib;}; in { options = { colorschemes.dracula = { diff --git a/plugins/colorschemes/gruvbox.nix b/plugins/colorschemes/gruvbox.nix index f1b4e30e90..2599b5ab9a 100644 --- a/plugins/colorschemes/gruvbox.nix +++ b/plugins/colorschemes/gruvbox.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.colorschemes.gruvbox; - helpers = import ../helpers.nix {inherit lib;}; colors = types.enum ["bg" "red" "green" "yellow" "blue" "purple" "aqua" "gray" "fg" "bg0_h" "bg0" "bg1" "bg2" "bg3" "bg4" "gray" "orange" "bg0_s" "fg0" "fg1" "fg2" "fg3" "fg4"]; in { options = { diff --git a/plugins/colorschemes/kanagawa.nix b/plugins/colorschemes/kanagawa.nix index 7892eef084..b13b346de8 100644 --- a/plugins/colorschemes/kanagawa.nix +++ b/plugins/colorschemes/kanagawa.nix @@ -1,12 +1,12 @@ { + lib, + helpers, pkgs, config, - lib, ... -} @ args: +}: with lib; let cfg = config.colorschemes.kanagawa; - helpers = import ../helpers.nix args; in { options = { colorschemes.kanagawa = diff --git a/plugins/colorschemes/melange.nix b/plugins/colorschemes/melange.nix index 2a338c072c..908dbf18ac 100644 --- a/plugins/colorschemes/melange.nix +++ b/plugins/colorschemes/melange.nix @@ -1,17 +1,17 @@ { - pkgs, lib, + helpers, + pkgs, config, ... }: let inherit (lib) mkEnableOption mkDefault mkIf; - inherit (import ../helpers.nix {inherit lib;}) mkPackageOption; cfg = config.colorschemes.melange; in { options = { colorschemes.melange = { enable = mkEnableOption "Melange colorscheme"; - package = mkPackageOption "melange.nvim" pkgs.vimPlugins.melange-nvim; + package = helpers.mkPackageOption "melange.nvim" pkgs.vimPlugins.melange-nvim; }; }; diff --git a/plugins/colorschemes/nord.nix b/plugins/colorschemes/nord.nix index 1163db1220..76c1c2f338 100644 --- a/plugins/colorschemes/nord.nix +++ b/plugins/colorschemes/nord.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.colorschemes.nord; - helpers = import ../helpers.nix {inherit lib;}; in { options = { colorschemes.nord = { diff --git a/plugins/colorschemes/one.nix b/plugins/colorschemes/one.nix index 02f41770e6..86f82f3171 100644 --- a/plugins/colorschemes/one.nix +++ b/plugins/colorschemes/one.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.colorschemes.one; - helpers = import ../helpers.nix {inherit lib;}; in { options = { colorschemes.one = { diff --git a/plugins/colorschemes/onedark.nix b/plugins/colorschemes/onedark.nix index 4ac675b112..a06cca1b39 100644 --- a/plugins/colorschemes/onedark.nix +++ b/plugins/colorschemes/onedark.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.colorschemes.onedark; - helpers = import ../helpers.nix {inherit lib;}; in { options = { colorschemes.onedark = { diff --git a/plugins/colorschemes/oxocarbon.nix b/plugins/colorschemes/oxocarbon.nix index 21ee948c1c..ace813a891 100644 --- a/plugins/colorschemes/oxocarbon.nix +++ b/plugins/colorschemes/oxocarbon.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.colorschemes.oxocarbon; - helpers = import ../helpers.nix {inherit lib;}; in { options = { colorschemes.oxocarbon = { diff --git a/plugins/colorschemes/poimandres.nix b/plugins/colorschemes/poimandres.nix index 77cf65cc8e..a54f9b05d5 100644 --- a/plugins/colorschemes/poimandres.nix +++ b/plugins/colorschemes/poimandres.nix @@ -1,12 +1,12 @@ { + lib, + helpers, pkgs, config, - lib, ... -} @ args: +}: with lib; let cfg = config.colorschemes.poimandres; - helpers = import ../helpers.nix args; in { options = { colorschemes.poimandres = diff --git a/plugins/colorschemes/rose-pine.nix b/plugins/colorschemes/rose-pine.nix index 11dd26a3e7..7136314ad6 100644 --- a/plugins/colorschemes/rose-pine.nix +++ b/plugins/colorschemes/rose-pine.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... -} @ args: +}: with lib; let cfg = config.colorschemes.rose-pine; - helpers = import ../helpers.nix args; in { options = { colorschemes.rose-pine = { diff --git a/plugins/colorschemes/tokyonight.nix b/plugins/colorschemes/tokyonight.nix index b80eac3f8c..be49583402 100644 --- a/plugins/colorschemes/tokyonight.nix +++ b/plugins/colorschemes/tokyonight.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... -} @ args: +}: with lib; let cfg = config.colorschemes.tokyonight; - helpers = import ../helpers.nix args; in { options = { colorschemes.tokyonight = { diff --git a/plugins/completion/copilot-lua.nix b/plugins/completion/copilot-lua.nix index a89660cf74..ede7b12b01 100644 --- a/plugins/completion/copilot-lua.nix +++ b/plugins/completion/copilot-lua.nix @@ -1,12 +1,12 @@ { + lib, + helpers, config, pkgs, - lib, ... }: with lib; let cfg = config.plugins.copilot-lua; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.copilot-lua = let diff --git a/plugins/completion/copilot-vim.nix b/plugins/completion/copilot-vim.nix index 63dab0a517..c1ab378347 100644 --- a/plugins/completion/copilot-vim.nix +++ b/plugins/completion/copilot-vim.nix @@ -1,12 +1,12 @@ { + lib, + helpers, config, pkgs, - lib, ... }: with lib; let cfg = config.plugins.copilot-vim; - helpers = import ../helpers.nix {inherit lib;}; in { imports = [ (lib.mkRenamedOptionModule ["plugins" "copilot"] ["plugins" "copilot-vim"]) diff --git a/plugins/completion/coq-thirdparty.nix b/plugins/completion/coq-thirdparty.nix index 350a340822..394577e912 100644 --- a/plugins/completion/coq-thirdparty.nix +++ b/plugins/completion/coq-thirdparty.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.coq-thirdparty; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.coq-thirdparty = { enable = mkEnableOption "coq-thirdparty"; diff --git a/plugins/completion/coq.nix b/plugins/completion/coq.nix index 225746da60..6d97d3985c 100644 --- a/plugins/completion/coq.nix +++ b/plugins/completion/coq.nix @@ -1,12 +1,12 @@ { - pkgs, lib, + helpers, config, + pkgs, ... }: with lib; let cfg = config.plugins.coq-nvim; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.coq-nvim = { diff --git a/plugins/completion/lspkind.nix b/plugins/completion/lspkind.nix index 23fcb217ab..847106b6f2 100644 --- a/plugins/completion/lspkind.nix +++ b/plugins/completion/lspkind.nix @@ -1,12 +1,12 @@ { + lib, + helpers, config, pkgs, - lib, ... }: with lib; let cfg = config.plugins.lspkind; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.lspkind = helpers.extraOptionsOptions diff --git a/plugins/completion/nvim-cmp/cmp-helpers.nix b/plugins/completion/nvim-cmp/cmp-helpers.nix index 0444180dad..b4a6ff6bda 100644 --- a/plugins/completion/nvim-cmp/cmp-helpers.nix +++ b/plugins/completion/nvim-cmp/cmp-helpers.nix @@ -1,8 +1,9 @@ { lib, + config, pkgs, ... -} @ attrs: let +}: let helpers = import ../../helpers.nix {inherit lib;}; in with helpers; @@ -13,7 +14,7 @@ in useDefaultPackage ? true, ... }: - mkPlugin attrs { + mkPlugin {inherit lib config pkgs;} { inherit name; extraPlugins = extraPlugins ++ (lists.optional useDefaultPackage pkgs.vimPlugins.${name}); description = "Enable ${name}"; diff --git a/plugins/completion/nvim-cmp/default.nix b/plugins/completion/nvim-cmp/default.nix index 3be29b31e0..cb1c240022 100644 --- a/plugins/completion/nvim-cmp/default.nix +++ b/plugins/completion/nvim-cmp/default.nix @@ -1,12 +1,12 @@ { + lib, + helpers, pkgs, config, - lib, ... } @ args: with lib; let cfg = config.plugins.nvim-cmp; - helpers = import ../../helpers.nix {inherit lib;}; cmpLib = import ./cmp-helpers.nix args; snippetEngines = { diff --git a/plugins/completion/nvim-cmp/sources/cmp-tabnine.nix b/plugins/completion/nvim-cmp/sources/cmp-tabnine.nix index 3b12fd7fcc..3498f16594 100644 --- a/plugins/completion/nvim-cmp/sources/cmp-tabnine.nix +++ b/plugins/completion/nvim-cmp/sources/cmp-tabnine.nix @@ -1,12 +1,11 @@ { - pkgs, - config, lib, + helpers, + config, ... }: with lib; let cfg = config.plugins.cmp-tabnine; - helpers = import ../../../helpers.nix {inherit lib;}; in { options.plugins.cmp-tabnine = helpers.extraOptionsOptions; diff --git a/plugins/completion/nvim-cmp/sources/copilot-cmp.nix b/plugins/completion/nvim-cmp/sources/copilot-cmp.nix index 66651068ca..e2c27d1c51 100644 --- a/plugins/completion/nvim-cmp/sources/copilot-cmp.nix +++ b/plugins/completion/nvim-cmp/sources/copilot-cmp.nix @@ -1,12 +1,12 @@ { - config, lib, + helpers, + config, ... }: with lib; let copilot-lua-cfg = config.plugins.copilot-lua; cfg = config.plugins.copilot-cmp; - helpers = import ../../../helpers.nix {inherit lib;}; in { options.plugins.copilot-cmp = helpers.extraOptionsOptions diff --git a/plugins/completion/nvim-cmp/sources/crates-nvim.nix b/plugins/completion/nvim-cmp/sources/crates-nvim.nix index 3eba68a3bb..181b2ed3cf 100644 --- a/plugins/completion/nvim-cmp/sources/crates-nvim.nix +++ b/plugins/completion/nvim-cmp/sources/crates-nvim.nix @@ -1,11 +1,11 @@ { - config, lib, + helpers, + config, ... }: with lib; let cfg = config.plugins.crates-nvim; - helpers = import ../../../helpers.nix {inherit lib;}; in { options.plugins.crates-nvim = helpers.extraOptionsOptions; diff --git a/plugins/completion/nvim-cmp/sources/default.nix b/plugins/completion/nvim-cmp/sources/default.nix index 29a1d22abe..f89411b19a 100644 --- a/plugins/completion/nvim-cmp/sources/default.nix +++ b/plugins/completion/nvim-cmp/sources/default.nix @@ -1,11 +1,12 @@ { lib, + config, pkgs, ... -} @ attrs: +}: with lib; let - cmpLib = import ../cmp-helpers.nix attrs; - cmpSourcesPluginNames = lib.attrValues cmpLib.pluginAndSourceNames; + cmpLib = import ../cmp-helpers.nix {inherit lib config pkgs;}; + cmpSourcesPluginNames = attrValues cmpLib.pluginAndSourceNames; pluginModules = lists.map (name: cmpLib.mkCmpSourcePlugin {inherit name;}) cmpSourcesPluginNames; in { # For extra cmp plugins diff --git a/plugins/dap/dap-go.nix b/plugins/dap/dap-go.nix index 3bb53a2d26..739fea89bc 100644 --- a/plugins/dap/dap-go.nix +++ b/plugins/dap/dap-go.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.dap.extensions.dap-go; - helpers = import ../helpers.nix {inherit lib;}; dapHelpers = import ./dapHelpers.nix {inherit lib;}; in { options.plugins.dap.extensions.dap-go = { diff --git a/plugins/dap/dap-python.nix b/plugins/dap/dap-python.nix index 31a301065d..e44c968778 100644 --- a/plugins/dap/dap-python.nix +++ b/plugins/dap/dap-python.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.dap.extensions.dap-python; - helpers = import ../helpers.nix {inherit lib;}; dapHelpers = import ./dapHelpers.nix {inherit lib;}; in { options.plugins.dap.extensions.dap-python = { diff --git a/plugins/dap/dap-ui.nix b/plugins/dap/dap-ui.nix index be7a52cd86..2880596d6c 100644 --- a/plugins/dap/dap-ui.nix +++ b/plugins/dap/dap-ui.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.dap.extensions.dap-ui; - helpers = import ../helpers.nix {inherit lib;}; mkSizeOption = helpers.mkNullOrOption diff --git a/plugins/dap/dap-virtual-text.nix b/plugins/dap/dap-virtual-text.nix index b278253a22..9a576bd6ae 100644 --- a/plugins/dap/dap-virtual-text.nix +++ b/plugins/dap/dap-virtual-text.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.dap.extensions.dap-virtual-text; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.dap.extensions.dap-virtual-text = { enable = mkEnableOption "dap-virtual-text"; diff --git a/plugins/dap/default.nix b/plugins/dap/default.nix index 1ce6d284d1..6ed1ca87c1 100644 --- a/plugins/dap/default.nix +++ b/plugins/dap/default.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.dap; - helpers = import ../helpers.nix {inherit lib;}; dapHelpers = import ./dapHelpers.nix {inherit lib;}; in with dapHelpers; { diff --git a/plugins/filetrees/chadtree.nix b/plugins/filetrees/chadtree.nix index a46854f1ef..ea9483548b 100644 --- a/plugins/filetrees/chadtree.nix +++ b/plugins/filetrees/chadtree.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.chadtree; - helpers = import ../helpers.nix {inherit lib;}; mkListStr = helpers.defaultNullOpts.mkNullable (types.listOf types.str); in { options.plugins.chadtree = diff --git a/plugins/filetrees/neo-tree.nix b/plugins/filetrees/neo-tree.nix index 4d27b54ac4..8136813b97 100644 --- a/plugins/filetrees/neo-tree.nix +++ b/plugins/filetrees/neo-tree.nix @@ -1,13 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.neo-tree; - helpers = import ../helpers.nix {inherit lib;}; - basePluginPath = ["plugins" "neo-tree"]; in { imports = [ diff --git a/plugins/filetrees/nvim-tree.nix b/plugins/filetrees/nvim-tree.nix index 8398338171..6e552d8e57 100644 --- a/plugins/filetrees/nvim-tree.nix +++ b/plugins/filetrees/nvim-tree.nix @@ -1,12 +1,12 @@ { + lib, + helpers, pkgs, config, - lib, ... -} @ args: +}: with lib; let cfg = config.plugins.nvim-tree; - helpers = import ../helpers.nix {inherit lib;}; inherit (helpers) ifNonNull'; openWinConfigOption = diff --git a/plugins/git/diffview.nix b/plugins/git/diffview.nix index 25a7cb07b6..abb704dd60 100644 --- a/plugins/git/diffview.nix +++ b/plugins/git/diffview.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.diffview; - helpers = import ../helpers.nix {inherit lib;}; mkWinConfig = type: width: height: position: with helpers.defaultNullOpts; { type = mkEnum ["split" "float"] type '' diff --git a/plugins/git/git-worktree.nix b/plugins/git/git-worktree.nix index 72824a386a..595adc290d 100644 --- a/plugins/git/git-worktree.nix +++ b/plugins/git/git-worktree.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.git-worktree; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.git-worktree = { diff --git a/plugins/git/gitblame.nix b/plugins/git/gitblame.nix index bb51e84106..414f3a1184 100644 --- a/plugins/git/gitblame.nix +++ b/plugins/git/gitblame.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.gitblame; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.gitblame = { diff --git a/plugins/git/gitgutter.nix b/plugins/git/gitgutter.nix index c6ca7bbfbc..c0057d82d2 100644 --- a/plugins/git/gitgutter.nix +++ b/plugins/git/gitgutter.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.gitgutter; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.gitgutter = { diff --git a/plugins/git/gitmessenger.nix b/plugins/git/gitmessenger.nix index 77f1590d71..b7ce06bf35 100644 --- a/plugins/git/gitmessenger.nix +++ b/plugins/git/gitmessenger.nix @@ -1,12 +1,11 @@ { - pkgs, lib, + helpers, config, + pkgs, ... -} @ args: -with lib; let - helpers = import ../helpers.nix args; -in { +}: +with lib; { options.plugins.gitmessenger = { enable = mkEnableOption "gitmessenger"; diff --git a/plugins/git/gitsigns.nix b/plugins/git/gitsigns.nix index cc4e0ce423..3f66e387b6 100644 --- a/plugins/git/gitsigns.nix +++ b/plugins/git/gitsigns.nix @@ -1,11 +1,11 @@ { - config, lib, + helpers, + config, pkgs, ... -} @ args: +}: with lib; let - helpers = import ../helpers.nix args; signOptions = defaults: { hl = helpers.defaultNullOpts.mkStr defaults.hl diff --git a/plugins/git/neogit.nix b/plugins/git/neogit.nix index c71a6b2235..d1b006c819 100644 --- a/plugins/git/neogit.nix +++ b/plugins/git/neogit.nix @@ -1,12 +1,12 @@ { - config, lib, + helpers, + config, pkgs, ... }: with lib; let cfg = config.plugins.neogit; - helpers = import ../helpers.nix {inherit lib;}; sectionDefaultsModule = types.submodule { options = { diff --git a/plugins/languages/clangd-extensions.nix b/plugins/languages/clangd-extensions.nix index 821950bf4d..4b652554e4 100644 --- a/plugins/languages/clangd-extensions.nix +++ b/plugins/languages/clangd-extensions.nix @@ -1,12 +1,12 @@ { lib, - pkgs, + helpers, config, + pkgs, ... }: with lib; let cfg = config.plugins.clangd-extensions; - helpers = import ../helpers.nix {inherit lib;}; basePluginPath = ["plugins" "clangd-extensions"]; diff --git a/plugins/languages/julia/julia-cell.nix b/plugins/languages/julia/julia-cell.nix index bb714d7dcc..c4a86abbde 100644 --- a/plugins/languages/julia/julia-cell.nix +++ b/plugins/languages/julia/julia-cell.nix @@ -1,11 +1,11 @@ { - pkgs, lib, + helpers, + pkgs, config, ... }: let cfg = config.plugins.julia-cell; - helpers = import ../../helpers.nix {inherit lib;}; # The keys are the option name in nixvim (under plugins.julia-cell.keymaps) # cmd: Such that the mapping action is ':JuliaCell${cmd}' diff --git a/plugins/languages/ledger.nix b/plugins/languages/ledger.nix index 1c7b163c55..d39c54c525 100644 --- a/plugins/languages/ledger.nix +++ b/plugins/languages/ledger.nix @@ -1,6 +1,6 @@ { - pkgs, lib, + pkgs, ... } @ args: with lib; diff --git a/plugins/languages/markdown-preview.nix b/plugins/languages/markdown-preview.nix index 16b1dfd6aa..2269631c07 100644 --- a/plugins/languages/markdown-preview.nix +++ b/plugins/languages/markdown-preview.nix @@ -1,12 +1,12 @@ { + lib, + helpers, config, pkgs, - lib, ... }: with lib; let cfg = config.plugins.markdown-preview; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.markdown-preview = { diff --git a/plugins/languages/nvim-jdtls.nix b/plugins/languages/nvim-jdtls.nix index ff445d2c92..b36e240fb1 100644 --- a/plugins/languages/nvim-jdtls.nix +++ b/plugins/languages/nvim-jdtls.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.nvim-jdtls; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.nvim-jdtls = helpers.extraOptionsOptions diff --git a/plugins/languages/openscad.nix b/plugins/languages/openscad.nix index 43f967492d..7cf27d3854 100644 --- a/plugins/languages/openscad.nix +++ b/plugins/languages/openscad.nix @@ -1,12 +1,12 @@ { lib, - pkgs, + helpers, config, + pkgs, ... -} @ args: +}: with lib; let defaultFuzzyFinder = "skim"; - helpers = import ../helpers.nix args; in { options.plugins.openscad = { enable = mkEnableOption "openscad.nvim, a plugin to manage OpenSCAD files"; diff --git a/plugins/languages/plantuml-syntax.nix b/plugins/languages/plantuml-syntax.nix index 4cf32991e5..889946831f 100644 --- a/plugins/languages/plantuml-syntax.nix +++ b/plugins/languages/plantuml-syntax.nix @@ -1,12 +1,11 @@ { - pkgs, lib, + helpers, config, + pkgs, ... }: -with lib; let - helpers = import ../helpers.nix {inherit lib;}; -in { +with lib; { options.plugins.plantuml-syntax = { enable = mkEnableOption "plantuml syntax support"; diff --git a/plugins/languages/rust.nix b/plugins/languages/rust.nix index f1ac8a57bf..18f16e8a23 100644 --- a/plugins/languages/rust.nix +++ b/plugins/languages/rust.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.rust-tools; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.rust-tools = helpers.extraOptionsOptions diff --git a/plugins/languages/sniprun.nix b/plugins/languages/sniprun.nix index afb6de4536..d62a452ba2 100644 --- a/plugins/languages/sniprun.nix +++ b/plugins/languages/sniprun.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.sniprun; - helpers = import ../helpers.nix {inherit lib;}; mkList = helpers.defaultNullOpts.mkNullable (types.listOf types.str); in { diff --git a/plugins/languages/tagbar.nix b/plugins/languages/tagbar.nix index 68431b2848..e5cac59393 100644 --- a/plugins/languages/tagbar.nix +++ b/plugins/languages/tagbar.nix @@ -1,11 +1,11 @@ { - pkgs, lib, + helpers, config, + pkgs, ... }: let cfg = config.plugins.tagbar; - helpers = import ../helpers.nix {inherit lib;}; in with lib; { options.plugins.tagbar = { diff --git a/plugins/languages/treesitter/rainbow-delimiters.nix b/plugins/languages/treesitter/rainbow-delimiters.nix index 2bf236b4fd..3931e815c8 100644 --- a/plugins/languages/treesitter/rainbow-delimiters.nix +++ b/plugins/languages/treesitter/rainbow-delimiters.nix @@ -1,12 +1,11 @@ { - pkgs, lib, + helpers, config, + pkgs, ... }: -with lib; let - helpers = import ../../helpers.nix {inherit lib;}; -in { +with lib; { # TODO those warnings have been added XX/XX/2023 # -> Remove them in ~ 1 month (oct. 2023) imports = diff --git a/plugins/languages/treesitter/treesitter-context.nix b/plugins/languages/treesitter/treesitter-context.nix index c8e73fef24..1490764741 100644 --- a/plugins/languages/treesitter/treesitter-context.nix +++ b/plugins/languages/treesitter/treesitter-context.nix @@ -1,12 +1,12 @@ { - pkgs, lib, + helpers, config, + pkgs, ... }: with lib; let cfg = config.plugins.treesitter-context; - helpers = import ../../helpers.nix {inherit lib;}; in { # Those warnings were introduced on 08/25/2023. TODO: remove them in October 2023. imports = let diff --git a/plugins/languages/treesitter/treesitter-refactor.nix b/plugins/languages/treesitter/treesitter-refactor.nix index 331ed2bf84..4a36858b76 100644 --- a/plugins/languages/treesitter/treesitter-refactor.nix +++ b/plugins/languages/treesitter/treesitter-refactor.nix @@ -1,12 +1,11 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: -with lib; let - helpers = import ../../helpers.nix {inherit lib;}; -in { +with lib; { options.plugins.treesitter-refactor = let disable = mkOption { type = types.listOf types.str; diff --git a/plugins/languages/treesitter/treesitter.nix b/plugins/languages/treesitter/treesitter.nix index d3e6e6dee7..cca4992401 100644 --- a/plugins/languages/treesitter/treesitter.nix +++ b/plugins/languages/treesitter/treesitter.nix @@ -1,12 +1,12 @@ { - pkgs, lib, + helpers, config, + pkgs, ... }: with lib; let cfg = config.plugins.treesitter; - helpers = import ../../helpers.nix {inherit lib;}; in { options = { plugins.treesitter = { diff --git a/plugins/languages/treesitter/ts-context-commentstring.nix b/plugins/languages/treesitter/ts-context-commentstring.nix index 3831f3f3cd..eab96666ff 100644 --- a/plugins/languages/treesitter/ts-context-commentstring.nix +++ b/plugins/languages/treesitter/ts-context-commentstring.nix @@ -1,12 +1,11 @@ { - pkgs, lib, + helpers, config, + pkgs, ... }: -with lib; let - helpers = import ../../helpers.nix {inherit lib;}; -in { +with lib; { options.plugins.ts-context-commentstring = helpers.extraOptionsOptions // { diff --git a/plugins/languages/typst/typst-vim.nix b/plugins/languages/typst/typst-vim.nix index 96c0f2bf87..ca5b3089c3 100644 --- a/plugins/languages/typst/typst-vim.nix +++ b/plugins/languages/typst/typst-vim.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.typst-vim; - helpers = import ../../helpers.nix {inherit lib;}; in { options.plugins.typst-vim = helpers.extraOptionsOptions diff --git a/plugins/languages/vim-slime.nix b/plugins/languages/vim-slime.nix index 23e88d5055..cb34bdd5ba 100644 --- a/plugins/languages/vim-slime.nix +++ b/plugins/languages/vim-slime.nix @@ -1,11 +1,11 @@ { - pkgs, lib, + helpers, config, + pkgs, ... }: let cfg = config.plugins.vim-slime; - helpers = import ../helpers.nix {inherit lib;}; in with lib; { options.plugins.vim-slime = { diff --git a/plugins/languages/vimtex.nix b/plugins/languages/vimtex.nix index dd1cb3d023..9e89df29e3 100644 --- a/plugins/languages/vimtex.nix +++ b/plugins/languages/vimtex.nix @@ -1,11 +1,11 @@ { - pkgs, lib, + helpers, config, + pkgs, ... }: let cfg = config.plugins.vimtex; - helpers = import ../helpers.nix {inherit lib;}; in with lib; { options.plugins.vimtex = { diff --git a/plugins/lsp/conform-nvim.nix b/plugins/lsp/conform-nvim.nix index d1e2044963..87c6e861a8 100644 --- a/plugins/lsp/conform-nvim.nix +++ b/plugins/lsp/conform-nvim.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.conform-nvim; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.conform-nvim = helpers.extraOptionsOptions diff --git a/plugins/lsp/default.nix b/plugins/lsp/default.nix index 29ebbad7f0..f604cc731c 100644 --- a/plugins/lsp/default.nix +++ b/plugins/lsp/default.nix @@ -1,12 +1,12 @@ { + lib, + helpers, config, pkgs, - lib, ... }: with lib; let cfg = config.plugins.lsp; - helpers = import ../helpers.nix {inherit lib;}; in { imports = [ ./language-servers diff --git a/plugins/lsp/fidget.nix b/plugins/lsp/fidget.nix index 2286015e08..82ccec86e9 100644 --- a/plugins/lsp/fidget.nix +++ b/plugins/lsp/fidget.nix @@ -1,12 +1,12 @@ { + lib, + helpers, config, pkgs, - lib, ... }: with lib; let cfg = config.plugins.fidget; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.fidget = diff --git a/plugins/lsp/helpers.nix b/plugins/lsp/helpers.nix index 8575e2c194..bddf1c89e1 100644 --- a/plugins/lsp/helpers.nix +++ b/plugins/lsp/helpers.nix @@ -1,7 +1,7 @@ { + lib, pkgs, config, - lib, ... }: { mkLsp = { diff --git a/plugins/lsp/inc-rename.nix b/plugins/lsp/inc-rename.nix index a26383b118..aaccfba45a 100644 --- a/plugins/lsp/inc-rename.nix +++ b/plugins/lsp/inc-rename.nix @@ -1,12 +1,11 @@ { lib, + helpers, config, pkgs, ... -} @ args: -with lib; let - helpers = import ../helpers.nix args; -in { +}: +with lib; { options.plugins.inc-rename = { enable = mkEnableOption "inc-rename, a plugin previewing LSP renaming"; diff --git a/plugins/lsp/language-servers/ccls.nix b/plugins/lsp/language-servers/ccls.nix index 43b45bd19b..e92c8b8328 100644 --- a/plugins/lsp/language-servers/ccls.nix +++ b/plugins/lsp/language-servers/ccls.nix @@ -1,11 +1,10 @@ { - pkgs, lib, + helpers, config, ... }: with lib; let - helpers = import ../../helpers.nix {inherit lib;}; cfg = config.plugins.lsp.servers.ccls; in { # Options: https://github.com/MaskRay/ccls/wiki/Customization#initialization-options diff --git a/plugins/lsp/language-servers/default.nix b/plugins/lsp/language-servers/default.nix index 6cf77c9e7d..df06093389 100644 --- a/plugins/lsp/language-servers/default.nix +++ b/plugins/lsp/language-servers/default.nix @@ -1,11 +1,12 @@ { - pkgs, lib, + helpers, + config, + pkgs, ... -} @ args: +}: with lib; let - lspHelpers = import ../helpers.nix args; - helpers = import ../../helpers.nix {inherit lib;}; + lspHelpers = import ../helpers.nix {inherit lib config pkgs;}; servers = [ { diff --git a/plugins/lsp/language-servers/efmls-configs.nix b/plugins/lsp/language-servers/efmls-configs.nix index 0bc748d599..2a6400e89c 100644 --- a/plugins/lsp/language-servers/efmls-configs.nix +++ b/plugins/lsp/language-servers/efmls-configs.nix @@ -1,12 +1,11 @@ { + lib, + helpers, config, pkgs, - lib, ... }: with lib; let - helpers = import ../../helpers.nix {inherit lib;}; - tools = trivial.importJSON ./efmls-configs-tools.json; inherit (tools) linters formatters; diff --git a/plugins/lsp/language-servers/nixd.nix b/plugins/lsp/language-servers/nixd.nix index 7901d4f37d..95e2c1eca3 100644 --- a/plugins/lsp/language-servers/nixd.nix +++ b/plugins/lsp/language-servers/nixd.nix @@ -1,11 +1,11 @@ { lib, + helpers, config, pkgs, ... }: with lib; let - helpers = import ../../helpers.nix {inherit lib;}; cfg = config.plugins.lsp.servers.nixd; in { # Options: https://github.com/nix-community/nixd/blob/main/docs/user-guide.md#configuration diff --git a/plugins/lsp/language-servers/pylsp.nix b/plugins/lsp/language-servers/pylsp.nix index 7a6c0ba8e7..d62005e0a9 100644 --- a/plugins/lsp/language-servers/pylsp.nix +++ b/plugins/lsp/language-servers/pylsp.nix @@ -1,11 +1,11 @@ { - pkgs, lib, + helpers, config, + pkgs, ... }: with lib; let - helpers = import ../../helpers.nix {inherit lib;}; cfg = config.plugins.lsp.servers.pylsp; in { # All settings are documented here: diff --git a/plugins/lsp/language-servers/svelte.nix b/plugins/lsp/language-servers/svelte.nix index 1f8d2ca34b..9221d7a992 100644 --- a/plugins/lsp/language-servers/svelte.nix +++ b/plugins/lsp/language-servers/svelte.nix @@ -1,10 +1,10 @@ { lib, + helpers, config, ... }: with lib; let - helpers = import ../../helpers.nix {inherit lib;}; cfg = config.plugins.lsp.servers.svelte; in { # Options: https://github.com/sveltejs/language-tools/tree/master/packages/language-server#settings diff --git a/plugins/lsp/lsp-format.nix b/plugins/lsp/lsp-format.nix index a02f3770d2..03dc21fc64 100644 --- a/plugins/lsp/lsp-format.nix +++ b/plugins/lsp/lsp-format.nix @@ -1,12 +1,12 @@ { - pkgs, lib, + helpers, config, + pkgs, ... }: with lib; let cfg = config.plugins.lsp-format; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.lsp-format = helpers.extraOptionsOptions diff --git a/plugins/lsp/lsp-lines.nix b/plugins/lsp/lsp-lines.nix index 67c55b66e5..4f085040bc 100644 --- a/plugins/lsp/lsp-lines.nix +++ b/plugins/lsp/lsp-lines.nix @@ -1,12 +1,12 @@ { - pkgs, lib, + helpers, config, + pkgs, ... }: with lib; let cfg = config.plugins.lsp-lines; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.lsp-lines = { diff --git a/plugins/lsp/lspsaga.nix b/plugins/lsp/lspsaga.nix index aeda7710f4..55b519e3a6 100644 --- a/plugins/lsp/lspsaga.nix +++ b/plugins/lsp/lspsaga.nix @@ -1,12 +1,12 @@ { - pkgs, lib, + helpers, config, + pkgs, ... }: with lib; let cfg = config.plugins.lspsaga; - helpers = import ../helpers.nix {inherit lib;}; mkKeymapOption = default: helpers.defaultNullOpts.mkNullable diff --git a/plugins/lsp/nvim-lightbulb.nix b/plugins/lsp/nvim-lightbulb.nix index c64a4d3936..ad27756f7f 100644 --- a/plugins/lsp/nvim-lightbulb.nix +++ b/plugins/lsp/nvim-lightbulb.nix @@ -1,90 +1,89 @@ { - pkgs, lib, + helpers, config, + pkgs, ... -}: let - helpers = import ../helpers.nix {inherit lib;}; -in - with lib; { - options.plugins.nvim-lightbulb = { - enable = mkEnableOption "nvim-lightbulb, showing available code actions"; +}: +with lib; { + options.plugins.nvim-lightbulb = { + enable = mkEnableOption "nvim-lightbulb, showing available code actions"; - package = helpers.mkPackageOption "nvim-lightbulb" pkgs.vimPlugins.nvim-lightbulb; + package = helpers.mkPackageOption "nvim-lightbulb" pkgs.vimPlugins.nvim-lightbulb; - ignore = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" '' - LSP client names to ignore - ''; + ignore = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" '' + LSP client names to ignore + ''; - sign = { - enabled = helpers.defaultNullOpts.mkBool true ""; - priority = helpers.defaultNullOpts.mkInt 10 ""; - }; + sign = { + enabled = helpers.defaultNullOpts.mkBool true ""; + priority = helpers.defaultNullOpts.mkInt 10 ""; + }; - float = { - enabled = helpers.defaultNullOpts.mkBool false ""; + float = { + enabled = helpers.defaultNullOpts.mkBool false ""; - text = helpers.defaultNullOpts.mkStr "💡" "Text to show in the popup float"; + text = helpers.defaultNullOpts.mkStr "💡" "Text to show in the popup float"; - winOpts = helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{}" '' - Options for the floating window (see |vim.lsp.util.open_floating_preview| for more information) - ''; - }; + winOpts = helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{}" '' + Options for the floating window (see |vim.lsp.util.open_floating_preview| for more information) + ''; + }; - virtualText = { - enabled = helpers.defaultNullOpts.mkBool false ""; + virtualText = { + enabled = helpers.defaultNullOpts.mkBool false ""; - text = helpers.defaultNullOpts.mkStr "💡" "Text to show at virtual text"; + text = helpers.defaultNullOpts.mkStr "💡" "Text to show at virtual text"; - hlMode = helpers.defaultNullOpts.mkStr "replace" '' - highlight mode to use for virtual text (replace, combine, blend), see - :help nvim_buf_set_extmark() for reference - ''; - }; + hlMode = helpers.defaultNullOpts.mkStr "replace" '' + highlight mode to use for virtual text (replace, combine, blend), see + :help nvim_buf_set_extmark() for reference + ''; + }; - statusText = { - enabled = helpers.defaultNullOpts.mkBool false ""; + statusText = { + enabled = helpers.defaultNullOpts.mkBool false ""; - text = helpers.defaultNullOpts.mkStr "💡" "Text to provide when code actions are available"; + text = helpers.defaultNullOpts.mkStr "💡" "Text to provide when code actions are available"; - textUnavailable = helpers.defaultNullOpts.mkStr "" '' - Text to provide when no actions are available - ''; - }; + textUnavailable = helpers.defaultNullOpts.mkStr "" '' + Text to provide when no actions are available + ''; + }; - autocmd = { - enabled = helpers.defaultNullOpts.mkBool false ""; + autocmd = { + enabled = helpers.defaultNullOpts.mkBool false ""; - pattern = helpers.defaultNullOpts.mkNullable (types.listOf types.str) ''["*"]'' ""; + pattern = helpers.defaultNullOpts.mkNullable (types.listOf types.str) ''["*"]'' ""; - events = - helpers.defaultNullOpts.mkNullable (types.listOf types.str) - ''["CursorHold" "CursorHoldI"]'' ""; - }; + events = + helpers.defaultNullOpts.mkNullable (types.listOf types.str) + ''["CursorHold" "CursorHoldI"]'' ""; }; + }; - config = let - cfg = config.plugins.nvim-lightbulb; - setupOptions = { - inherit (cfg) ignore sign autocmd; - float = { - inherit (cfg.float) enabled text; - win_opts = cfg.float.winOpts; - }; - virtual_text = { - inherit (cfg.virtualText) enabled text; - hl_mode = cfg.virtualText.hlMode; - }; - status_text = { - inherit (cfg.statusText) enabled text; - text_unavailable = cfg.statusText.textUnavailable; - }; + config = let + cfg = config.plugins.nvim-lightbulb; + setupOptions = { + inherit (cfg) ignore sign autocmd; + float = { + inherit (cfg.float) enabled text; + win_opts = cfg.float.winOpts; + }; + virtual_text = { + inherit (cfg.virtualText) enabled text; + hl_mode = cfg.virtualText.hlMode; }; - in - mkIf cfg.enable { - extraPlugins = [cfg.package]; - extraConfigLua = '' - require("nvim-lightbulb").setup(${helpers.toLuaObject setupOptions}) - ''; + status_text = { + inherit (cfg.statusText) enabled text; + text_unavailable = cfg.statusText.textUnavailable; }; - } + }; + in + mkIf cfg.enable { + extraPlugins = [cfg.package]; + extraConfigLua = '' + require("nvim-lightbulb").setup(${helpers.toLuaObject setupOptions}) + ''; + }; +} diff --git a/plugins/lsp/trouble.nix b/plugins/lsp/trouble.nix index f4129bd5d5..734d19c377 100644 --- a/plugins/lsp/trouble.nix +++ b/plugins/lsp/trouble.nix @@ -1,11 +1,11 @@ { + lib, + helpers, config, pkgs, - lib, ... }: let cfg = config.plugins.trouble; - helpers = import ../helpers.nix {inherit lib;}; in with lib; { options.plugins.trouble = diff --git a/plugins/none-ls/default.nix b/plugins/none-ls/default.nix index c4fc61db2a..8928c5c0cb 100644 --- a/plugins/none-ls/default.nix +++ b/plugins/none-ls/default.nix @@ -1,12 +1,12 @@ { + lib, + helpers, config, pkgs, - lib, ... }: with lib; let cfg = config.plugins.none-ls; - helpers = import ../helpers.nix {inherit lib;}; in { imports = [ ./servers.nix diff --git a/plugins/none-ls/helpers.nix b/plugins/none-ls/helpers.nix index 007e74be85..f6cdbcbb7b 100644 --- a/plugins/none-ls/helpers.nix +++ b/plugins/none-ls/helpers.nix @@ -1,9 +1,4 @@ { - pkgs, - config, - lib, - ... -}: { mkServer = { name, sourceType, diff --git a/plugins/none-ls/servers.nix b/plugins/none-ls/servers.nix index 448dd89c08..95b918d3ff 100644 --- a/plugins/none-ls/servers.nix +++ b/plugins/none-ls/servers.nix @@ -3,8 +3,8 @@ config, lib, ... -} @ args: let - helpers = import ./helpers.nix args; +}: let + helpers = import ./helpers.nix; serverData = { code_actions = { eslint = { diff --git a/plugins/pluginmanagers/packer.nix b/plugins/pluginmanagers/packer.nix index 4f92f3b344..916358131a 100644 --- a/plugins/pluginmanagers/packer.nix +++ b/plugins/pluginmanagers/packer.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.packer; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.packer = { diff --git a/plugins/snippets/luasnip/default.nix b/plugins/snippets/luasnip/default.nix index 17493c3e82..6824d628ac 100644 --- a/plugins/snippets/luasnip/default.nix +++ b/plugins/snippets/luasnip/default.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.luasnip; - helpers = import ../../helpers.nix {inherit lib;}; in { options.plugins.luasnip = { enable = mkEnableOption "luasnip"; diff --git a/plugins/statuslines/airline.nix b/plugins/statuslines/airline.nix index 9c9c661199..ecfccf877f 100644 --- a/plugins/statuslines/airline.nix +++ b/plugins/statuslines/airline.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.airline; - helpers = import ../helpers.nix {inherit lib;}; sectionType = with types; nullOr (oneOf [str (listOf str)]); sectionOption = mkOption { diff --git a/plugins/statuslines/lightline.nix b/plugins/statuslines/lightline.nix index 5a96a9db12..4cb1579465 100644 --- a/plugins/statuslines/lightline.nix +++ b/plugins/statuslines/lightline.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.lightline; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.lightline = { diff --git a/plugins/statuslines/lualine.nix b/plugins/statuslines/lualine.nix index a9354ca7b1..2a6df76d2b 100644 --- a/plugins/statuslines/lualine.nix +++ b/plugins/statuslines/lualine.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.lualine; - helpers = import ../helpers.nix {inherit lib;}; mkSeparatorsOption = { leftDefault ? " ", diff --git a/plugins/telescope/default.nix b/plugins/telescope/default.nix index a9079c962c..6b723ba464 100644 --- a/plugins/telescope/default.nix +++ b/plugins/telescope/default.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.telescope; - helpers = import ../helpers.nix {inherit lib;}; in { imports = [ ./file-browser.nix diff --git a/plugins/telescope/file-browser.nix b/plugins/telescope/file-browser.nix index e85cfc173b..da6e587a8e 100644 --- a/plugins/telescope/file-browser.nix +++ b/plugins/telescope/file-browser.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.telescope.extensions.file_browser; - helpers = import ../helpers.nix {inherit lib;}; hiddenOption = types.submodule { options = { diff --git a/plugins/telescope/frecency.nix b/plugins/telescope/frecency.nix index fb4065df1a..e45997e412 100644 --- a/plugins/telescope/frecency.nix +++ b/plugins/telescope/frecency.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.telescope.extensions.frecency; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.telescope.extensions.frecency = { enable = mkEnableOption "frecency"; diff --git a/plugins/telescope/fzf-native.nix b/plugins/telescope/fzf-native.nix index 32717d538e..afca000669 100644 --- a/plugins/telescope/fzf-native.nix +++ b/plugins/telescope/fzf-native.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.telescope.extensions.fzf-native; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.telescope.extensions.fzf-native = { enable = mkEnableOption "fzf-native"; diff --git a/plugins/telescope/media-files.nix b/plugins/telescope/media-files.nix index 1a565f0f96..50dcd9f7aa 100644 --- a/plugins/telescope/media-files.nix +++ b/plugins/telescope/media-files.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.telescope.extensions.media_files; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.telescope.extensions.media_files = { enable = mkEnableOption "media_files extension for telescope"; diff --git a/plugins/telescope/project-nvim.nix b/plugins/telescope/project-nvim.nix index b19de997f1..1f6e3a5c56 100644 --- a/plugins/telescope/project-nvim.nix +++ b/plugins/telescope/project-nvim.nix @@ -1,7 +1,6 @@ { - pkgs, - config, lib, + config, ... }: with lib; let diff --git a/plugins/telescope/undo.nix b/plugins/telescope/undo.nix index 98424dbbe6..400461c77e 100644 --- a/plugins/telescope/undo.nix +++ b/plugins/telescope/undo.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.telescope.extensions.undo; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.telescope.extensions.undo = { enable = mkEnableOption "undo"; diff --git a/plugins/ui/noice.nix b/plugins/ui/noice.nix index d57e5d6021..90da57c37f 100644 --- a/plugins/ui/noice.nix +++ b/plugins/ui/noice.nix @@ -1,15 +1,14 @@ { lib, - pkgs, + helpers, config, + pkgs, ... -} @ args: +}: # TODO: This uses a lot of types.anything because noice.nvim types are quite complex. # It should be possible to map them to nix, but they would not map really well through # toLuaObject, we would maybe need some ad-hoc pre-processing functions. -with lib; let - helpers = import ../helpers.nix args; -in { +with lib; { options.plugins.noice = helpers.extraOptionsOptions // { @@ -254,7 +253,7 @@ in { lsp_doc_border = false; } '' " - you can enable a preset by setting it to true, or a table that will override the preset + you can enable a preset by setting it to true, or a table that will override the preset config. you can also add custom presets that you can enable/disable with enabled=true "; diff --git a/plugins/utils/alpha.nix b/plugins/utils/alpha.nix index c4920d22da..1e49f12d8a 100644 --- a/plugins/utils/alpha.nix +++ b/plugins/utils/alpha.nix @@ -1,14 +1,13 @@ { - config, lib, + helpers, + config, pkgs, ... }: with lib; let cfg = config.plugins.alpha; - helpers = import ../helpers.nix {inherit lib;}; - sectionType = types.enum ["group" "padding" "text"]; mkAlphaSectionOption = type: @@ -85,71 +84,70 @@ in { default = true; }; - layout = with helpers; - mkOption { - default = [ - { - type = "padding"; - val = 2; - } - { - type = "text"; - val = [ - " ███╗ ██╗██╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ " - " ████╗ ██║██║╚██╗██╔╝██║ ██║██║████╗ ████║ " - " ██╔██╗ ██║██║ ╚███╔╝ ██║ ██║██║██╔████╔██║ " - " ██║╚██╗██║██║ ██╔██╗ ╚██╗ ██╔╝██║██║╚██╔╝██║ " - " ██║ ╚████║██║██╔╝ ██╗ ╚████╔╝ ██║██║ ╚═╝ ██║ " - " ╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ " - ]; - opts = { - position = "center"; - hl = "Type"; - }; - } - { - type = "padding"; - val = 2; - } - { - type = "group"; - val = [ - { - shortcut = "e"; - desc = " New file"; - command = "ene "; - } - { - shortcut = "SPC q"; - desc = " Quit Neovim"; - command = ":qa"; - } - ]; - } - { - type = "padding"; - val = 2; - } - { - type = "text"; - val = "Inspiring quote here."; - opts = { - position = "center"; - hl = "Keyword"; - }; - } - ]; - description = "List of sections to layout for the dashboard"; - type = types.listOf (mkAlphaSectionOption sectionType); - }; + layout = mkOption { + default = [ + { + type = "padding"; + val = 2; + } + { + type = "text"; + val = [ + " ███╗ ██╗██╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ " + " ████╗ ██║██║╚██╗██╔╝██║ ██║██║████╗ ████║ " + " ██╔██╗ ██║██║ ╚███╔╝ ██║ ██║██║██╔████╔██║ " + " ██║╚██╗██║██║ ██╔██╗ ╚██╗ ██╔╝██║██║╚██╔╝██║ " + " ██║ ╚████║██║██╔╝ ██╗ ╚████╔╝ ██║██║ ╚═╝ ██║ " + " ╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ " + ]; + opts = { + position = "center"; + hl = "Type"; + }; + } + { + type = "padding"; + val = 2; + } + { + type = "group"; + val = [ + { + shortcut = "e"; + desc = " New file"; + command = "ene "; + } + { + shortcut = "SPC q"; + desc = " Quit Neovim"; + command = ":qa"; + } + ]; + } + { + type = "padding"; + val = 2; + } + { + type = "text"; + val = "Inspiring quote here."; + opts = { + position = "center"; + hl = "Keyword"; + }; + } + ]; + description = "List of sections to layout for the dashboard"; + type = types.listOf (mkAlphaSectionOption sectionType); + }; }; }; - config = with helpers; let + config = let processButton = button: let stringifyButton = button: ''button("${button.shortcut}", "${button.desc}", "${button.command}")''; in - mkRaw (stringifyButton button); + helpers.mkRaw (stringifyButton button); processButtons = attrset: if attrset.type == "group" @@ -203,7 +201,7 @@ in { end local config = { - layout = ${toLuaObject options.layout}, + layout = ${helpers.toLuaObject options.layout}, opts = { margin = 5, }, diff --git a/plugins/utils/auto-save.nix b/plugins/utils/auto-save.nix index 27a72ff00b..85e6f56b40 100644 --- a/plugins/utils/auto-save.nix +++ b/plugins/utils/auto-save.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.auto-save; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.auto-save = helpers.extraOptionsOptions diff --git a/plugins/utils/auto-session.nix b/plugins/utils/auto-session.nix index 5440724ce2..c67237cddb 100644 --- a/plugins/utils/auto-session.nix +++ b/plugins/utils/auto-session.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.auto-session; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.auto-session = helpers.extraOptionsOptions diff --git a/plugins/utils/better-escape.nix b/plugins/utils/better-escape.nix index bd100ee989..19d27b1f48 100644 --- a/plugins/utils/better-escape.nix +++ b/plugins/utils/better-escape.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.better-escape; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.better-escape = helpers.extraOptionsOptions diff --git a/plugins/utils/comment-nvim.nix b/plugins/utils/comment-nvim.nix index 0436022030..fb18896d89 100644 --- a/plugins/utils/comment-nvim.nix +++ b/plugins/utils/comment-nvim.nix @@ -1,12 +1,12 @@ { + lib, + helpers, config, pkgs, - lib, ... }: with lib; let cfg = config.plugins.comment-nvim; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.comment-nvim = { diff --git a/plugins/utils/commentary.nix b/plugins/utils/commentary.nix index 8c1475c52f..f886a80b78 100644 --- a/plugins/utils/commentary.nix +++ b/plugins/utils/commentary.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.commentary; - helpers = import ../helpers.nix {inherit lib;}; in { # TODO Add support for aditional filetypes. This requires autocommands! diff --git a/plugins/utils/conjure.nix b/plugins/utils/conjure.nix index 6f6f86a8e5..5fe7295ebb 100644 --- a/plugins/utils/conjure.nix +++ b/plugins/utils/conjure.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.conjure; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.conjure = { enable = mkEnableOption "Conjure"; diff --git a/plugins/utils/coverage.nix b/plugins/utils/coverage.nix index 88c21d315c..705301129b 100644 --- a/plugins/utils/coverage.nix +++ b/plugins/utils/coverage.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.coverage; - helpers = import ../helpers.nix {inherit lib;}; keymapsDef = { coverage = { diff --git a/plugins/utils/cursorline.nix b/plugins/utils/cursorline.nix index 54a4337a28..aeaec39f42 100644 --- a/plugins/utils/cursorline.nix +++ b/plugins/utils/cursorline.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.cursorline; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.cursorline = helpers.extraOptionsOptions diff --git a/plugins/utils/dashboard.nix b/plugins/utils/dashboard.nix index a4271289ad..27f1e513dd 100644 --- a/plugins/utils/dashboard.nix +++ b/plugins/utils/dashboard.nix @@ -1,13 +1,12 @@ { - config, lib, + helpers, + config, pkgs, ... }: with lib; let cfg = config.plugins.dashboard; - - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.dashboard = { diff --git a/plugins/utils/easyescape.nix b/plugins/utils/easyescape.nix index dcb3bac86b..0dd1b4c848 100644 --- a/plugins/utils/easyescape.nix +++ b/plugins/utils/easyescape.nix @@ -1,12 +1,12 @@ { + lib, + helpers, config, pkgs, - lib, ... }: with lib; let cfg = config.plugins.easyescape; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.easyescape = { diff --git a/plugins/utils/flash.nix b/plugins/utils/flash.nix index 2e2f47ec66..ecafd05e84 100644 --- a/plugins/utils/flash.nix +++ b/plugins/utils/flash.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.flash; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.flash = let configOpts = { diff --git a/plugins/utils/floaterm.nix b/plugins/utils/floaterm.nix index b6c20ed672..18a7073b37 100644 --- a/plugins/utils/floaterm.nix +++ b/plugins/utils/floaterm.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.floaterm; - helpers = import ../helpers.nix {inherit lib;}; settings = { shell = { diff --git a/plugins/utils/hardtime.nix b/plugins/utils/hardtime.nix index 8adc59f9e6..c6f4d53d32 100644 --- a/plugins/utils/hardtime.nix +++ b/plugins/utils/hardtime.nix @@ -1,12 +1,12 @@ { + lib, + helpers, config, pkgs, - lib, ... }: with lib; let cfg = config.plugins.hardtime; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.hardtime = diff --git a/plugins/utils/harpoon.nix b/plugins/utils/harpoon.nix index 5850cb7246..9893df689e 100644 --- a/plugins/utils/harpoon.nix +++ b/plugins/utils/harpoon.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.harpoon; - helpers = import ../helpers.nix {inherit lib;}; projectConfigModule = types.submodule { options = { diff --git a/plugins/utils/hmts.nix b/plugins/utils/hmts.nix index 4718582d72..8b280a24e1 100644 --- a/plugins/utils/hmts.nix +++ b/plugins/utils/hmts.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.hmts; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.hmts = helpers.extraOptionsOptions diff --git a/plugins/utils/illuminate.nix b/plugins/utils/illuminate.nix index f8ee9e4460..607f97a990 100644 --- a/plugins/utils/illuminate.nix +++ b/plugins/utils/illuminate.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.illuminate; - helpers = import ../helpers.nix {inherit lib;}; mkListStr = helpers.defaultNullOpts.mkNullable (types.listOf types.str); diff --git a/plugins/utils/indent-blankline.nix b/plugins/utils/indent-blankline.nix index 28735e90dd..b3359c5f4f 100644 --- a/plugins/utils/indent-blankline.nix +++ b/plugins/utils/indent-blankline.nix @@ -1,11 +1,11 @@ { lib, - pkgs, + helpers, config, + pkgs, ... -} @ args: +}: with lib; let - helpers = import ../helpers.nix args; basePluginPath = ["plugins" "indent-blankline"]; in { # TODO: Those warnings were introduced on 2023/10/17. diff --git a/plugins/utils/instant.nix b/plugins/utils/instant.nix index cbb350bb59..6c239f791b 100644 --- a/plugins/utils/instant.nix +++ b/plugins/utils/instant.nix @@ -1,12 +1,11 @@ { lib, - pkgs, + helpers, config, + pkgs, ... -} @ args: -with lib; let - helpers = import ../helpers.nix args; -in { +}: +with lib; { options.plugins.instant = { enable = mkEnableOption "instant.nvim"; diff --git a/plugins/utils/intellitab.nix b/plugins/utils/intellitab.nix index 00e9d825b1..dbe05ab51b 100644 --- a/plugins/utils/intellitab.nix +++ b/plugins/utils/intellitab.nix @@ -1,12 +1,12 @@ { + lib, + helpers, config, pkgs, - lib, ... }: with lib; let cfg = config.plugins.intellitab; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.intellitab = { diff --git a/plugins/utils/lastplace.nix b/plugins/utils/lastplace.nix index b33eec2ca1..ff8530caa8 100644 --- a/plugins/utils/lastplace.nix +++ b/plugins/utils/lastplace.nix @@ -1,11 +1,11 @@ { - pkgs, lib, + helpers, config, + pkgs, ... }: let cfg = config.plugins.lastplace; - helpers = import ../helpers.nix {inherit lib;}; in with lib; { options.plugins.lastplace = diff --git a/plugins/utils/leap.nix b/plugins/utils/leap.nix index 42e616875b..eb5fafe7bb 100644 --- a/plugins/utils/leap.nix +++ b/plugins/utils/leap.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.leap; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.leap = helpers.extraOptionsOptions diff --git a/plugins/utils/magma-nvim.nix b/plugins/utils/magma-nvim.nix index dc14f53ba2..194dde9671 100644 --- a/plugins/utils/magma-nvim.nix +++ b/plugins/utils/magma-nvim.nix @@ -1,6 +1,6 @@ { - pkgs, lib, + pkgs, ... } @ args: with lib; diff --git a/plugins/utils/mark-radar.nix b/plugins/utils/mark-radar.nix index 1b35ff7e2d..d55c49affc 100644 --- a/plugins/utils/mark-radar.nix +++ b/plugins/utils/mark-radar.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.mark-radar; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.mark-radar = helpers.extraOptionsOptions diff --git a/plugins/utils/mini.nix b/plugins/utils/mini.nix index 1e0dabe132..37a4e30fc8 100644 --- a/plugins/utils/mini.nix +++ b/plugins/utils/mini.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.mini; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.mini = { enable = mkEnableOption "mini.nvim"; diff --git a/plugins/utils/mkdnflow.nix b/plugins/utils/mkdnflow.nix index 2b116688f2..1a8dacf4af 100644 --- a/plugins/utils/mkdnflow.nix +++ b/plugins/utils/mkdnflow.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.mkdnflow; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.mkdnflow = helpers.extraOptionsOptions diff --git a/plugins/utils/multicursors.nix b/plugins/utils/multicursors.nix index a703f42ba3..536eb673db 100644 --- a/plugins/utils/multicursors.nix +++ b/plugins/utils/multicursors.nix @@ -1,12 +1,12 @@ { + lib, + helpers, config, pkgs, - lib, ... }: with lib; let cfg = config.plugins.multicursors; - helpers = import ../helpers.nix {inherit lib;}; keyOptionType = with types; attrsOf ( diff --git a/plugins/utils/navbuddy.nix b/plugins/utils/navbuddy.nix index a8cca6085a..9c9c7f0050 100644 --- a/plugins/utils/navbuddy.nix +++ b/plugins/utils/navbuddy.nix @@ -1,12 +1,12 @@ { lib, - pkgs, + helpers, config, + pkgs, ... }: with lib; let cfg = config.plugins.navbuddy; - helpers = import ../helpers.nix {inherit lib;}; percentageType = types.ints.between 0 100; mkPercentageOpt = default: helpers.defaultNullOpts.mkNullable percentageType (toString default); diff --git a/plugins/utils/neogen.nix b/plugins/utils/neogen.nix index 9a59ff006e..034b1a3752 100644 --- a/plugins/utils/neogen.nix +++ b/plugins/utils/neogen.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.neogen; - helpers = import ../helpers.nix {inherit lib;}; keymapDef = { generate = { diff --git a/plugins/utils/neorg.nix b/plugins/utils/neorg.nix index a303725d75..301ba4b6cc 100644 --- a/plugins/utils/neorg.nix +++ b/plugins/utils/neorg.nix @@ -1,11 +1,11 @@ { - pkgs, lib, + helpers, config, + pkgs, ... }: let cfg = config.plugins.neorg; - helpers = import ../helpers.nix {inherit lib;}; in with lib; { options.plugins.neorg = diff --git a/plugins/utils/netman.nix b/plugins/utils/netman.nix index 1ac348e4f4..3a56bea556 100644 --- a/plugins/utils/netman.nix +++ b/plugins/utils/netman.nix @@ -1,29 +1,28 @@ { - config, lib, + helpers, + config, pkgs, ... -} @ args: let - helpers = import ../helpers.nix args; -in - with lib; { - options.plugins.netman = { - enable = mkEnableOption "netman.nvim, a framework to access remote resources"; +}: +with lib; { + options.plugins.netman = { + enable = mkEnableOption "netman.nvim, a framework to access remote resources"; - package = helpers.mkPackageOption "netman.nvim" pkgs.vimPlugins.netman-nvim; + package = helpers.mkPackageOption "netman.nvim" pkgs.vimPlugins.netman-nvim; - neoTreeIntegration = mkEnableOption "support for netman as a neo-tree source"; - }; + neoTreeIntegration = mkEnableOption "support for netman as a neo-tree source"; + }; - config = let - cfg = config.plugins.netman; - in - mkIf cfg.enable { - extraPlugins = [cfg.package]; - extraConfigLua = '' - require("netman") - ''; + config = let + cfg = config.plugins.netman; + in + mkIf cfg.enable { + extraPlugins = [cfg.package]; + extraConfigLua = '' + require("netman") + ''; - plugins.neo-tree.extraSources = mkIf cfg.neoTreeIntegration ["netman.ui.neo-tree"]; - }; - } + plugins.neo-tree.extraSources = mkIf cfg.neoTreeIntegration ["netman.ui.neo-tree"]; + }; +} diff --git a/plugins/utils/nix-develop.nix b/plugins/utils/nix-develop.nix index 04e089b087..0771685bc4 100644 --- a/plugins/utils/nix-develop.nix +++ b/plugins/utils/nix-develop.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.nix-develop; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.nix-develop = helpers.extraOptionsOptions diff --git a/plugins/utils/notify.nix b/plugins/utils/notify.nix index 037d8b2f57..80f301a014 100644 --- a/plugins/utils/notify.nix +++ b/plugins/utils/notify.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.notify; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.notify = helpers.extraOptionsOptions diff --git a/plugins/utils/nvim-autopairs.nix b/plugins/utils/nvim-autopairs.nix index d4c75630d9..88398fd268 100644 --- a/plugins/utils/nvim-autopairs.nix +++ b/plugins/utils/nvim-autopairs.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.nvim-autopairs; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.nvim-autopairs = helpers.extraOptionsOptions diff --git a/plugins/utils/nvim-bqf.nix b/plugins/utils/nvim-bqf.nix index 4a9b3f8ba4..156eac4971 100644 --- a/plugins/utils/nvim-bqf.nix +++ b/plugins/utils/nvim-bqf.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.nvim-bqf; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.nvim-bqf = helpers.extraOptionsOptions diff --git a/plugins/utils/nvim-colorizer.nix b/plugins/utils/nvim-colorizer.nix index 51f9164566..4383c745ab 100644 --- a/plugins/utils/nvim-colorizer.nix +++ b/plugins/utils/nvim-colorizer.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.nvim-colorizer; - helpers = import ../helpers.nix {inherit lib;}; colorizer-options = { RGB = mkOption { diff --git a/plugins/utils/nvim-osc52.nix b/plugins/utils/nvim-osc52.nix index 93d1e9cf6f..390062b4ec 100644 --- a/plugins/utils/nvim-osc52.nix +++ b/plugins/utils/nvim-osc52.nix @@ -1,94 +1,93 @@ { - pkgs, lib, + helpers, + pkgs, config, ... -} @ args: let - helpers = import ../helpers.nix args; -in - with lib; { - options.plugins.nvim-osc52 = { - enable = mkEnableOption "nvim-osc52, a plugin to use OSC52 sequences to copy/paste"; +}: +with lib; { + options.plugins.nvim-osc52 = { + enable = mkEnableOption "nvim-osc52, a plugin to use OSC52 sequences to copy/paste"; - package = helpers.mkPackageOption "nvim-osc52" pkgs.vimPlugins.nvim-osc52; + package = helpers.mkPackageOption "nvim-osc52" pkgs.vimPlugins.nvim-osc52; - maxLength = - helpers.defaultNullOpts.mkInt 0 "Maximum length of selection (0 for no limit)"; - silent = helpers.defaultNullOpts.mkBool false "Disable message on successful copy"; - trim = helpers.defaultNullOpts.mkBool false "Trim text before copy"; + maxLength = + helpers.defaultNullOpts.mkInt 0 "Maximum length of selection (0 for no limit)"; + silent = helpers.defaultNullOpts.mkBool false "Disable message on successful copy"; + trim = helpers.defaultNullOpts.mkBool false "Trim text before copy"; - keymaps = { - enable = mkEnableOption "keymaps for copying using OSC52"; + keymaps = { + enable = mkEnableOption "keymaps for copying using OSC52"; - silent = mkOption { - type = types.bool; - description = "Wether nvim-osc52 keymaps should be silent"; - default = false; - }; + silent = mkOption { + type = types.bool; + description = "Wether nvim-osc52 keymaps should be silent"; + default = false; + }; - copy = mkOption { - type = types.str; - description = "Copy into the system clipboard using OSC52"; - default = "y"; - }; + copy = mkOption { + type = types.str; + description = "Copy into the system clipboard using OSC52"; + default = "y"; + }; - copyLine = mkOption { - type = types.str; - description = "Copy line into the system clipboard using OSC52"; - default = "yy"; - }; + copyLine = mkOption { + type = types.str; + description = "Copy line into the system clipboard using OSC52"; + default = "yy"; + }; - copyVisual = mkOption { - type = types.str; - description = "Copy visual selection into the system clipboard using OSC52"; - default = "y"; - }; + copyVisual = mkOption { + type = types.str; + description = "Copy visual selection into the system clipboard using OSC52"; + default = "y"; }; }; + }; - config = let - cfg = config.plugins.nvim-osc52; - setupOptions = with cfg; { - inherit silent trim; - max_length = maxLength; - }; - in - mkIf cfg.enable { - extraPlugins = [cfg.package]; + config = let + cfg = config.plugins.nvim-osc52; + setupOptions = with cfg; { + inherit silent trim; + max_length = maxLength; + }; + in + mkIf cfg.enable { + extraPlugins = [cfg.package]; - keymaps = with cfg.keymaps; - mkIf enable - [ - { - mode = "n"; - key = copy; - action = "require('osc52').copy_operator"; - lua = true; - options = { - expr = true; - inherit silent; - }; - } - { - mode = "n"; - key = copyLine; - action = "${copy}_"; - options = { - remap = true; - inherit silent; - }; - } - { - mode = "v"; - key = copyVisual; - action = "require('osc52').copy_visual"; - lua = true; - options.silent = silent; - } - ]; + keymaps = with cfg.keymaps; + mkIf enable + [ + { + mode = "n"; + key = copy; + action = "require('osc52').copy_operator"; + lua = true; + options = { + expr = true; + inherit silent; + }; + } + { + mode = "n"; + key = copyLine; + action = "${copy}_"; + options = { + remap = true; + inherit silent; + }; + } + { + mode = "v"; + key = copyVisual; + action = "require('osc52').copy_visual"; + lua = true; + options.silent = silent; + } + ]; - extraConfigLua = '' - require('osc52').setup(${helpers.toLuaObject setupOptions}) - ''; - }; - } + extraConfigLua = '' + require('osc52').setup(${helpers.toLuaObject setupOptions}) + ''; + }; +} diff --git a/plugins/utils/nvim-ufo.nix b/plugins/utils/nvim-ufo.nix index bdc970b143..9daf548b49 100644 --- a/plugins/utils/nvim-ufo.nix +++ b/plugins/utils/nvim-ufo.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.nvim-ufo; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.nvim-ufo = helpers.extraOptionsOptions diff --git a/plugins/utils/oil.nix b/plugins/utils/oil.nix index 5f19d6985f..ca11ef77ce 100644 --- a/plugins/utils/oil.nix +++ b/plugins/utils/oil.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.oil; - helpers = import ../helpers.nix {inherit lib;}; fractionType = types.numbers.between 0.0 1.0; diff --git a/plugins/utils/persistence.nix b/plugins/utils/persistence.nix index be42c3a95e..96c4bf3fde 100644 --- a/plugins/utils/persistence.nix +++ b/plugins/utils/persistence.nix @@ -1,12 +1,11 @@ { - config, lib, + helpers, + config, pkgs, ... }: -with lib; let - helpers = import ../helpers.nix {inherit lib;}; -in { +with lib; { options.plugins.persistence = helpers.extraOptionsOptions // { diff --git a/plugins/utils/presence-nvim.nix b/plugins/utils/presence-nvim.nix index 7b9e82b939..9da008cf97 100644 --- a/plugins/utils/presence-nvim.nix +++ b/plugins/utils/presence-nvim.nix @@ -1,12 +1,12 @@ { + lib, + helpers, config, pkgs, - lib, ... }: with lib; let cfg = config.plugins.presence-nvim; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.presence-nvim = diff --git a/plugins/utils/project-nvim.nix b/plugins/utils/project-nvim.nix index a255d8c297..7d906fcfcd 100644 --- a/plugins/utils/project-nvim.nix +++ b/plugins/utils/project-nvim.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.project-nvim; - helpers = import ../helpers.nix {inherit lib pkgs;}; in { options.plugins.project-nvim = helpers.extraOptionsOptions diff --git a/plugins/utils/quickmath.nix b/plugins/utils/quickmath.nix index 570a7f0733..e0f9337d5d 100644 --- a/plugins/utils/quickmath.nix +++ b/plugins/utils/quickmath.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.quickmath; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.quickmath = { enable = mkEnableOption "quickmath.nvim"; diff --git a/plugins/utils/refactoring.nix b/plugins/utils/refactoring.nix index 227f976dff..fa4b139378 100644 --- a/plugins/utils/refactoring.nix +++ b/plugins/utils/refactoring.nix @@ -1,12 +1,11 @@ { - config, lib, + helpers, + config, pkgs, ... }: -with lib; let - helpers = import ../helpers.nix {inherit lib;}; -in { +with lib; { options.plugins.refactoring = helpers.extraOptionsOptions // { diff --git a/plugins/utils/specs.nix b/plugins/utils/specs.nix index ebfbdc99e7..21d028655a 100644 --- a/plugins/utils/specs.nix +++ b/plugins/utils/specs.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.specs; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.specs = { enable = mkEnableOption "specs-nvim"; diff --git a/plugins/utils/spider.nix b/plugins/utils/spider.nix index 77f160bd08..1d364145bd 100644 --- a/plugins/utils/spider.nix +++ b/plugins/utils/spider.nix @@ -1,13 +1,13 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let pluginName = "spider"; cfg = config.plugins.${pluginName}; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.${pluginName} = helpers.extraOptionsOptions diff --git a/plugins/utils/startify.nix b/plugins/utils/startify.nix index b24c350630..e4679147fd 100644 --- a/plugins/utils/startify.nix +++ b/plugins/utils/startify.nix @@ -1,6 +1,6 @@ { - pkgs, lib, + pkgs, ... } @ args: let helpers = import ../helpers.nix {inherit lib;}; diff --git a/plugins/utils/tmux-navigator.nix b/plugins/utils/tmux-navigator.nix index e811680554..1462f5bf31 100644 --- a/plugins/utils/tmux-navigator.nix +++ b/plugins/utils/tmux-navigator.nix @@ -1,12 +1,12 @@ { - config, lib, + helpers, + config, pkgs, ... -} @ attrs: +}: with lib; let cfg = config.plugins.tmux-navigator; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.tmux-navigator = { enable = mkEnableOption "Tmux-Navigator (see https://github.com/christoomey/vim-tmux-navigator for tmux installation instruction)"; diff --git a/plugins/utils/todo-comments.nix b/plugins/utils/todo-comments.nix index 2465079f27..114515c7d1 100644 --- a/plugins/utils/todo-comments.nix +++ b/plugins/utils/todo-comments.nix @@ -1,12 +1,12 @@ { + lib, + helpers, config, pkgs, - lib, ... }: with lib; let cfg = config.plugins.todo-comments; - helpers = import ../helpers.nix {inherit lib;}; commands = { todoQuickFix = "TodoQuickFix"; diff --git a/plugins/utils/toggleterm.nix b/plugins/utils/toggleterm.nix index d19933d870..d646d2da33 100644 --- a/plugins/utils/toggleterm.nix +++ b/plugins/utils/toggleterm.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.toggleterm; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.toggleterm = { enable = mkEnableOption "toggleterm"; diff --git a/plugins/utils/undotree.nix b/plugins/utils/undotree.nix index 230716694a..0971b1a81c 100644 --- a/plugins/utils/undotree.nix +++ b/plugins/utils/undotree.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.undotree; - helpers = import ../helpers.nix {inherit lib;}; in { options = { plugins.undotree = { diff --git a/plugins/utils/vim-bbye.nix b/plugins/utils/vim-bbye.nix index de5ee6076e..0071e836a7 100644 --- a/plugins/utils/vim-bbye.nix +++ b/plugins/utils/vim-bbye.nix @@ -1,12 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.vim-bbye; - helpers = import ../helpers.nix {inherit lib;}; in { options.plugins.vim-bbye = { enable = mkEnableOption "vim-bbye"; diff --git a/plugins/utils/vim-matchup.nix b/plugins/utils/vim-matchup.nix index 1951a2672a..153c29fb4e 100644 --- a/plugins/utils/vim-matchup.nix +++ b/plugins/utils/vim-matchup.nix @@ -1,12 +1,11 @@ { + lib, + helpers, pkgs, config, - lib, ... -} @ args: -with lib; let - helpers = import ../helpers.nix args; -in { +}: +with lib; { options.plugins.vim-matchup = { enable = mkEnableOption "vim-matchup"; diff --git a/plugins/utils/which-key.nix b/plugins/utils/which-key.nix index a729ea472c..ea2520d326 100644 --- a/plugins/utils/which-key.nix +++ b/plugins/utils/which-key.nix @@ -1,12 +1,11 @@ { + lib, + helpers, pkgs, config, - lib, ... -} @ args: -with lib; let - helpers = import ../helpers.nix args; -in { +}: +with lib; { options.plugins.which-key = { enable = mkEnableOption diff --git a/plugins/utils/wilder.nix b/plugins/utils/wilder.nix index 4a61c11580..3ba21b9c4f 100644 --- a/plugins/utils/wilder.nix +++ b/plugins/utils/wilder.nix @@ -1,19 +1,12 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... }: with lib; let cfg = config.plugins.wilder; - helpers = import ../helpers.nix {inherit lib;}; - - boolToInt = value: - if value == null - then null - else if value - then "1" - else "0"; mkKeyOption = default: desc: helpers.defaultNullOpts.mkNullable diff --git a/plugins/utils/zk.nix b/plugins/utils/zk.nix index b950bee07d..182f9bbeb2 100644 --- a/plugins/utils/zk.nix +++ b/plugins/utils/zk.nix @@ -1,12 +1,11 @@ { - pkgs, - config, lib, + helpers, + config, + pkgs, ... -} @ args: -with lib; let - helpers = import ../helpers.nix args; -in { +}: +with lib; { options.plugins.zk = { enable = mkEnableOption "zk.nvim, a plugin to integrate with zk"; diff --git a/tests/lib-tests.nix b/tests/lib-tests.nix index 2087d896fe..c8ad9fc59b 100644 --- a/tests/lib-tests.nix +++ b/tests/lib-tests.nix @@ -1,10 +1,10 @@ # For shorter test iterations run the following in the root of the repo: # `echo ':b checks.${builtins.currentSystem}.lib-tests' | nix repl .` { - pkgs, lib, + pkgs, }: let - helpers = import ../lib/helpers.nix {inherit pkgs lib;}; + helpers = import ../lib/helpers.nix {inherit lib pkgs;}; results = pkgs.lib.runTests { testToLuaObject = { expr = helpers.toLuaObject {