diff --git a/modules/autocmd.nix b/modules/autocmd.nix index 2d980c1c..f873d0a2 100644 --- a/modules/autocmd.nix +++ b/modules/autocmd.nix @@ -58,7 +58,7 @@ (lib.optionalString (autoGroups != { }) '' -- Set up autogroups {{ do - local __nixvim_autogroups = ${helpers.toLuaObject autoGroups} + local __nixvim_autogroups = ${lib.nixvim.toLuaObject autoGroups} for group_name, options in pairs(__nixvim_autogroups) do vim.api.nvim_create_augroup(group_name, options) @@ -69,7 +69,7 @@ + (lib.optionalString (autoCmd != [ ]) '' -- Set up autocommands {{ do - local __nixvim_autocommands = ${helpers.toLuaObject autoCmd} + local __nixvim_autocommands = ${lib.nixvim.toLuaObject autoCmd} for _, autocmd in ipairs(__nixvim_autocommands) do vim.api.nvim_create_autocmd( diff --git a/modules/commands.nix b/modules/commands.nix index ba1a9d48..b0fda39f 100644 --- a/modules/commands.nix +++ b/modules/commands.nix @@ -73,7 +73,7 @@ in in lib.mkIf (config.userCommands != { }) { extraConfigLua = helpers.wrapDo '' - local cmds = ${helpers.toLuaObject (lib.mapAttrs cleanupCommand config.userCommands)}; + local cmds = ${lib.nixvim.toLuaObject (lib.mapAttrs cleanupCommand config.userCommands)}; for name,cmd in pairs(cmds) do vim.api.nvim_create_user_command(name, cmd.command, cmd.options or {}) end diff --git a/modules/diagnostics.nix b/modules/diagnostics.nix index e850cb49..471aa32e 100644 --- a/modules/diagnostics.nix +++ b/modules/diagnostics.nix @@ -19,7 +19,7 @@ config = { extraConfigLuaPre = lib.mkIf (config.diagnostics != { }) '' - vim.diagnostic.config(${helpers.toLuaObject config.diagnostics}) + vim.diagnostic.config(${lib.nixvim.toLuaObject config.diagnostics}) ''; }; } diff --git a/modules/filetype.nix b/modules/filetype.nix index c9d747b5..943ae732 100644 --- a/modules/filetype.nix +++ b/modules/filetype.nix @@ -58,6 +58,6 @@ in config.extraConfigLua = lib.mkIf (cfg != null && (builtins.any (v: v != null) (builtins.attrValues cfg))) '' - vim.filetype.add(${helpers.toLuaObject cfg}) + vim.filetype.add(${lib.nixvim.toLuaObject cfg}) ''; } diff --git a/modules/highlights.nix b/modules/highlights.nix index 72cbf9e7..46ce0fc9 100644 --- a/modules/highlights.nix +++ b/modules/highlights.nix @@ -42,7 +42,7 @@ '' -- Highlight groups {{ do - local highlights = ${helpers.toLuaObject config.highlight} + local highlights = ${lib.nixvim.toLuaObject config.highlight} for k,v in pairs(highlights) do vim.api.nvim_set_hl(0, k, v) @@ -56,7 +56,7 @@ '' -- Highlight groups {{ do - local highlights = ${helpers.toLuaObject config.highlightOverride} + local highlights = ${lib.nixvim.toLuaObject config.highlightOverride} for k,v in pairs(highlights) do vim.api.nvim_set_hl(0, k, v) @@ -72,7 +72,7 @@ '' -- Match groups {{ do - local match = ${helpers.toLuaObject config.match} + local match = ${lib.nixvim.toLuaObject config.match} for k,v in pairs(match) do vim.fn.matchadd(k, v) diff --git a/modules/keymaps.nix b/modules/keymaps.nix index 1fe874de..fa1b45cd 100644 --- a/modules/keymaps.nix +++ b/modules/keymaps.nix @@ -81,7 +81,7 @@ extraConfigLua = lib.mkIf (config.keymaps != [ ]) '' -- Set up keybinds {{{ do - local __nixvim_binds = ${helpers.toLuaObject (map helpers.keymaps.removeDeprecatedMapAttrs config.keymaps)} + local __nixvim_binds = ${lib.nixvim.toLuaObject (map helpers.keymaps.removeDeprecatedMapAttrs config.keymaps)} for i, map in ipairs(__nixvim_binds) do vim.keymap.set(map.mode, map.key, map.action, map.options) end @@ -99,7 +99,7 @@ callback = helpers.mkRaw '' function() do - local __nixvim_binds = ${helpers.toLuaObject (map helpers.keymaps.removeDeprecatedMapAttrs mappings)} + local __nixvim_binds = ${lib.nixvim.toLuaObject (map helpers.keymaps.removeDeprecatedMapAttrs mappings)} for i, map in ipairs(__nixvim_binds) do vim.keymap.set(map.mode, map.key, map.action, map.options) end diff --git a/modules/opts.nix b/modules/opts.nix index 4ca93d63..9aca2bef 100644 --- a/modules/opts.nix +++ b/modules/opts.nix @@ -67,7 +67,7 @@ in }: let varName = "nixvim_${luaVariableName}"; - optionDefinitions = helpers.toLuaObject config.${optionName}; + optionDefinitions = lib.nixvim.toLuaObject config.${optionName}; in lib.optionalString (optionDefinitions != "{ }") '' -- Set up ${prettyName} {{{ diff --git a/plugins/by-name/autoclose/default.nix b/plugins/by-name/autoclose/default.nix index 6b6733f7..32a3b492 100644 --- a/plugins/by-name/autoclose/default.nix +++ b/plugins/by-name/autoclose/default.nix @@ -86,7 +86,7 @@ in }; in '' - require('autoclose').setup(${helpers.toLuaObject setupOptions}) + require('autoclose').setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/chadtree/default.nix b/plugins/by-name/chadtree/default.nix index 01e932d2..7bf52ac3 100644 --- a/plugins/by-name/chadtree/default.nix +++ b/plugins/by-name/chadtree/default.nix @@ -516,7 +516,7 @@ in extraPlugins = [ cfg.package ]; extraConfigLua = '' - vim.api.nvim_set_var("chadtree_settings", ${helpers.toLuaObject setupOptions}) + vim.api.nvim_set_var("chadtree_settings", ${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/clangd-extensions/default.nix b/plugins/by-name/clangd-extensions/default.nix index f67ebc90..9ef3452c 100644 --- a/plugins/by-name/clangd-extensions/default.nix +++ b/plugins/by-name/clangd-extensions/default.nix @@ -265,7 +265,7 @@ in extraPlugins = [ cfg.package ]; plugins.lsp.postConfig = '' - require("clangd_extensions").setup(${helpers.toLuaObject setupOptions}) + require("clangd_extensions").setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/clipboard-image/default.nix b/plugins/by-name/clipboard-image/default.nix index fa49b30d..fa885bcf 100644 --- a/plugins/by-name/clipboard-image/default.nix +++ b/plugins/by-name/clipboard-image/default.nix @@ -153,7 +153,7 @@ in // cfg.extraOptions; in '' - require('clipboard-image').setup(${helpers.toLuaObject setupOptions}) + require('clipboard-image').setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/copilot-lua/default.nix b/plugins/by-name/copilot-lua/default.nix index 3ee569aa..385bccbd 100644 --- a/plugins/by-name/copilot-lua/default.nix +++ b/plugins/by-name/copilot-lua/default.nix @@ -214,7 +214,7 @@ in // cfg.extraOptions; in '' - require('copilot').setup(${helpers.toLuaObject setupOptions}) + require('copilot').setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/coq-thirdparty/default.nix b/plugins/by-name/coq-thirdparty/default.nix index 657246f0..6b4a3456 100644 --- a/plugins/by-name/coq-thirdparty/default.nix +++ b/plugins/by-name/coq-thirdparty/default.nix @@ -66,7 +66,7 @@ in extraPlugins = [ cfg.package ]; extraConfigLua = '' - require('coq_3p')(${helpers.toLuaObject cfg.sources}) + require('coq_3p')(${lib.nixvim.toLuaObject cfg.sources}) ''; }; } diff --git a/plugins/by-name/coverage/default.nix b/plugins/by-name/coverage/default.nix index a6ddf716..94b41c6b 100644 --- a/plugins/by-name/coverage/default.nix +++ b/plugins/by-name/coverage/default.nix @@ -267,7 +267,7 @@ in extraPlugins = [ cfg.package ]; extraConfigLua = '' - require("coverage").setup(${helpers.toLuaObject setupOptions}) + require("coverage").setup(${lib.nixvim.toLuaObject setupOptions}) ''; keymaps = flatten ( diff --git a/plugins/by-name/cursorline/default.nix b/plugins/by-name/cursorline/default.nix index d9dd60ce..adf1bb17 100644 --- a/plugins/by-name/cursorline/default.nix +++ b/plugins/by-name/cursorline/default.nix @@ -55,7 +55,7 @@ in extraPlugins = [ cfg.package ]; extraConfigLua = '' - require('nvim-cursorline').setup(${helpers.toLuaObject options}) + require('nvim-cursorline').setup(${lib.nixvim.toLuaObject options}) ''; }; } diff --git a/plugins/by-name/dap/dap-go.nix b/plugins/by-name/dap/dap-go.nix index 4b7867bc..f254ca71 100644 --- a/plugins/by-name/dap/dap-go.nix +++ b/plugins/by-name/dap/dap-go.nix @@ -61,7 +61,7 @@ in plugins.dap = { enable = true; extensionConfigLua = '' - require("dap-go").setup(${helpers.toLuaObject options}) + require("dap-go").setup(${lib.nixvim.toLuaObject options}) ''; }; }; diff --git a/plugins/by-name/dap/dap-ui.nix b/plugins/by-name/dap/dap-ui.nix index fa38e8ba..19692fc3 100644 --- a/plugins/by-name/dap/dap-ui.nix +++ b/plugins/by-name/dap/dap-ui.nix @@ -239,7 +239,7 @@ in enable = true; extensionConfigLua = '' - require("dapui").setup(${helpers.toLuaObject options}); + require("dapui").setup(${lib.nixvim.toLuaObject options}); ''; }; }; diff --git a/plugins/by-name/dap/dap-virtual-text.nix b/plugins/by-name/dap/dap-virtual-text.nix index 5ba81c7c..60048f61 100644 --- a/plugins/by-name/dap/dap-virtual-text.nix +++ b/plugins/by-name/dap/dap-virtual-text.nix @@ -94,7 +94,7 @@ in enable = true; extensionConfigLua = '' - require("nvim-dap-virtual-text").setup(${helpers.toLuaObject options}); + require("nvim-dap-virtual-text").setup(${lib.nixvim.toLuaObject options}); ''; }; }; diff --git a/plugins/by-name/dap/default.nix b/plugins/by-name/dap/default.nix index c73cb958..d0236875 100644 --- a/plugins/by-name/dap/default.nix +++ b/plugins/by-name/dap/default.nix @@ -90,13 +90,13 @@ with dapHelpers; extraConfigLua = (optionalString (cfg.adapters != null) '' - require("dap").adapters = ${helpers.toLuaObject options.adapters} + require("dap").adapters = ${lib.nixvim.toLuaObject options.adapters} '') + (optionalString (options.configurations != null) '' - require("dap").configurations = ${helpers.toLuaObject options.configurations} + require("dap").configurations = ${lib.nixvim.toLuaObject options.configurations} '') + (optionalString (cfg.signs != null) '' - local __dap_signs = ${helpers.toLuaObject options.signs} + local __dap_signs = ${lib.nixvim.toLuaObject options.signs} for sign_name, sign in pairs(__dap_signs) do vim.fn.sign_define(sign_name, sign) end diff --git a/plugins/by-name/diffview/default.nix b/plugins/by-name/diffview/default.nix index b45e1115..7c027f5b 100644 --- a/plugins/by-name/diffview/default.nix +++ b/plugins/by-name/diffview/default.nix @@ -835,7 +835,7 @@ in extraPlugins = [ cfg.package ]; extraConfigLua = '' - require("diffview").setup(${helpers.toLuaObject setupOptions}) + require("diffview").setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/fidget/default.nix b/plugins/by-name/fidget/default.nix index de30a327..a88cc793 100644 --- a/plugins/by-name/fidget/default.nix +++ b/plugins/by-name/fidget/default.nix @@ -677,7 +677,7 @@ in // cfg.extraOptions; in '' - require("fidget").setup${helpers.toLuaObject setupOptions} + require("fidget").setup${lib.nixvim.toLuaObject setupOptions} ''; }; } diff --git a/plugins/by-name/fzf-lua/default.nix b/plugins/by-name/fzf-lua/default.nix index 928e3437..3ae7c0f1 100644 --- a/plugins/by-name/fzf-lua/default.nix +++ b/plugins/by-name/fzf-lua/default.nix @@ -135,7 +135,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { if isString mapping then "${mapping}()" else - "${mapping.action}(${helpers.toLuaObject mapping.settings})"; + "${mapping.action}(${lib.nixvim.toLuaObject mapping.settings})"; in { inherit key; diff --git a/plugins/by-name/git-worktree/default.nix b/plugins/by-name/git-worktree/default.nix index bddcc422..54608700 100644 --- a/plugins/by-name/git-worktree/default.nix +++ b/plugins/by-name/git-worktree/default.nix @@ -85,7 +85,7 @@ in telescopeCfg = ''require("telescope").load_extension("git_worktree")''; in '' - require('git-worktree').setup(${helpers.toLuaObject setupOptions}) + require('git-worktree').setup(${lib.nixvim.toLuaObject setupOptions}) ${if cfg.enableTelescope then telescopeCfg else ""} ''; }; diff --git a/plugins/by-name/gitlinker/default.nix b/plugins/by-name/gitlinker/default.nix index 01c0bf34..7dcc1ece 100644 --- a/plugins/by-name/gitlinker/default.nix +++ b/plugins/by-name/gitlinker/default.nix @@ -103,7 +103,7 @@ with lib; // cfg.extraOptions; in '' - require('gitlinker').setup(${helpers.toLuaObject setupOptions}) + require('gitlinker').setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/harpoon/default.nix b/plugins/by-name/harpoon/default.nix index 6d09f69c..6826d748 100644 --- a/plugins/by-name/harpoon/default.nix +++ b/plugins/by-name/harpoon/default.nix @@ -205,7 +205,7 @@ in telescopeCfg = ''require("telescope").load_extension("harpoon")''; in '' - require('harpoon').setup(${helpers.toLuaObject setupOptions}) + require('harpoon').setup(${lib.nixvim.toLuaObject setupOptions}) ${if cfg.enableTelescope then telescopeCfg else ""} ''; diff --git a/plugins/by-name/hydra/default.nix b/plugins/by-name/hydra/default.nix index f50ae7ee..94f09611 100644 --- a/plugins/by-name/hydra/default.nix +++ b/plugins/by-name/hydra/default.nix @@ -39,9 +39,9 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { plugins.hydra.luaConfig.content = '' hydra = require('hydra') - hydra.setup(${helpers.toLuaObject cfg.settings}) + hydra.setup(${lib.nixvim.toLuaObject cfg.settings}) - __hydra_defs = ${helpers.toLuaObject cfg.hydras} + __hydra_defs = ${lib.nixvim.toLuaObject cfg.hydras} for _, hydra_config in ipairs(__hydra_defs) do hydra(hydra_config) end diff --git a/plugins/by-name/illuminate/default.nix b/plugins/by-name/illuminate/default.nix index 627480d0..c7e66c32 100644 --- a/plugins/by-name/illuminate/default.nix +++ b/plugins/by-name/illuminate/default.nix @@ -150,7 +150,7 @@ in extraPlugins = [ cfg.package ]; extraConfigLua = '' - require("illuminate").configure(${helpers.toLuaObject setupOptions}) + require("illuminate").configure(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/image/default.nix b/plugins/by-name/image/default.nix index 38e9a2e7..3a4d55b2 100644 --- a/plugins/by-name/image/default.nix +++ b/plugins/by-name/image/default.nix @@ -166,7 +166,7 @@ in // cfg.extraOptions; in '' - require('image').setup(${helpers.toLuaObject setupOptions}) + require('image').setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/inc-rename/default.nix b/plugins/by-name/inc-rename/default.nix index 1a23fa81..7eac6be4 100644 --- a/plugins/by-name/inc-rename/default.nix +++ b/plugins/by-name/inc-rename/default.nix @@ -55,7 +55,7 @@ with lib; extraPlugins = [ cfg.package ]; extraConfigLua = '' - require("inc_rename").setup(${helpers.toLuaObject setupOptions}) + require("inc_rename").setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/lastplace/default.nix b/plugins/by-name/lastplace/default.nix index caf594f1..e00dc39c 100644 --- a/plugins/by-name/lastplace/default.nix +++ b/plugins/by-name/lastplace/default.nix @@ -48,7 +48,7 @@ with lib; extraPlugins = [ cfg.package ]; extraConfigLua = '' - require('nvim-lastplace').setup(${helpers.toLuaObject options}) + require('nvim-lastplace').setup(${lib.nixvim.toLuaObject options}) ''; }; } diff --git a/plugins/by-name/lean/default.nix b/plugins/by-name/lean/default.nix index 69c9394f..4eddcaf1 100644 --- a/plugins/by-name/lean/default.nix +++ b/plugins/by-name/lean/default.nix @@ -301,7 +301,7 @@ in // cfg.extraOptions; in '' - require("lean").setup(${helpers.toLuaObject setupOptions}) + require("lean").setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/leap/default.nix b/plugins/by-name/leap/default.nix index 46923006..b06debe8 100644 --- a/plugins/by-name/leap/default.nix +++ b/plugins/by-name/leap/default.nix @@ -183,7 +183,7 @@ in + (optionalString (options != { }) '' require('leap').opts = vim.tbl_deep_extend( "keep", - ${helpers.toLuaObject options}, + ${lib.nixvim.toLuaObject options}, require('leap').opts ) ''); diff --git a/plugins/by-name/lint/default.nix b/plugins/by-name/lint/default.nix index 9b266396..86f0c3f7 100644 --- a/plugins/by-name/lint/default.nix +++ b/plugins/by-name/lint/default.nix @@ -233,7 +233,7 @@ in extraConfigLua = '' __lint = require('lint') - __lint.linters_by_ft = ${helpers.toLuaObject cfg.lintersByFt} + __lint.linters_by_ft = ${lib.nixvim.toLuaObject cfg.lintersByFt} '' + (optionalString (cfg.linters != { }) ( concatLines ( @@ -244,7 +244,7 @@ in propName: propValue: optionalString ( propValue != null - ) ''__lint.linters["${linter}"]["${propName}"] = ${helpers.toLuaObject propValue}'' + ) ''__lint.linters["${linter}"]["${propName}"] = ${lib.nixvim.toLuaObject propValue}'' ) linterConfig ) cfg.linters ) @@ -257,7 +257,7 @@ in let linterConfig' = if isString linterConfig then helpers.mkRaw linterConfig else linterConfig; in - ''__lint.linters["${customLinter}"] = ${helpers.toLuaObject linterConfig'}'' + ''__lint.linters["${customLinter}"] = ${lib.nixvim.toLuaObject linterConfig'}'' ) cfg.customLinters ) )); diff --git a/plugins/by-name/lspkind/default.nix b/plugins/by-name/lspkind/default.nix index 5212f671..df3716f8 100644 --- a/plugins/by-name/lspkind/default.nix +++ b/plugins/by-name/lspkind/default.nix @@ -75,21 +75,21 @@ in extraPlugins = [ cfg.package ]; extraConfigLua = optionalString (!doCmp) '' - require('lspkind').init(${helpers.toLuaObject options}) + require('lspkind').init(${lib.nixvim.toLuaObject options}) ''; plugins.cmp.settings.formatting.format = if cfg.cmp.after != null then '' function(entry, vim_item) - local kind = require('lspkind').cmp_format(${helpers.toLuaObject options})(entry, vim_item) + local kind = require('lspkind').cmp_format(${lib.nixvim.toLuaObject options})(entry, vim_item) return (${cfg.cmp.after})(entry, vim_item, kind) end '' else '' - require('lspkind').cmp_format(${helpers.toLuaObject options}) + require('lspkind').cmp_format(${lib.nixvim.toLuaObject options}) ''; }; } diff --git a/plugins/by-name/lspsaga/default.nix b/plugins/by-name/lspsaga/default.nix index a070eca8..36d7cbee 100644 --- a/plugins/by-name/lspsaga/default.nix +++ b/plugins/by-name/lspsaga/default.nix @@ -636,7 +636,7 @@ in // cfg.extraOptions; in '' - require('lspsaga').setup(${helpers.toLuaObject setupOptions}) + require('lspsaga').setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/ltex-extra/default.nix b/plugins/by-name/ltex-extra/default.nix index eb3d8e50..5ea867cd 100644 --- a/plugins/by-name/ltex-extra/default.nix +++ b/plugins/by-name/ltex-extra/default.nix @@ -55,7 +55,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { enable = true; onAttach.function = '' - require("ltex_extra").setup(${helpers.toLuaObject cfg.settings}) + require("ltex_extra").setup(${lib.nixvim.toLuaObject cfg.settings}) ''; }; }; diff --git a/plugins/by-name/luasnip/default.nix b/plugins/by-name/luasnip/default.nix index 41bd74d0..21d48c46 100644 --- a/plugins/by-name/luasnip/default.nix +++ b/plugins/by-name/luasnip/default.nix @@ -186,18 +186,18 @@ in ] loader; in '' - require("luasnip.loaders.from_${name}").${optionalString loader.lazyLoad "lazy_"}load(${helpers.toLuaObject options}) + require("luasnip.loaders.from_${name}").${optionalString loader.lazyLoad "lazy_"}load(${lib.nixvim.toLuaObject options}) '' )) ]; filetypeExtendConfig = mapAttrsToList (n: v: '' - require("luasnip").filetype_extend("${n}", ${helpers.toLuaObject v}) + require("luasnip").filetype_extend("${n}", ${lib.nixvim.toLuaObject v}) '') cfg.filetypeExtend; extraConfig = [ '' - require("luasnip").config.setup(${helpers.toLuaObject cfg.settings}) + require("luasnip").config.setup(${lib.nixvim.toLuaObject cfg.settings}) '' ]; in diff --git a/plugins/by-name/mark-radar/default.nix b/plugins/by-name/mark-radar/default.nix index 8f5582f7..e0c40685 100644 --- a/plugins/by-name/mark-radar/default.nix +++ b/plugins/by-name/mark-radar/default.nix @@ -42,7 +42,7 @@ in extraPlugins = [ cfg.package ]; extraConfigLua = '' - require("mark-radar").setup(${helpers.toLuaObject setupOptions}) + require("mark-radar").setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/marks/default.nix b/plugins/by-name/marks/default.nix index 324f7cd3..8034571c 100644 --- a/plugins/by-name/marks/default.nix +++ b/plugins/by-name/marks/default.nix @@ -184,7 +184,7 @@ in // cfg.extraOptions; in '' - require('marks').setup(${helpers.toLuaObject setupOptions}) + require('marks').setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/mkdnflow/default.nix b/plugins/by-name/mkdnflow/default.nix index 859902c1..8b17520d 100644 --- a/plugins/by-name/mkdnflow/default.nix +++ b/plugins/by-name/mkdnflow/default.nix @@ -645,7 +645,7 @@ in extraPlugins = [ cfg.package ]; extraConfigLua = '' - require("mkdnflow").setup(${helpers.toLuaObject setupOptions}) + require("mkdnflow").setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/multicursors/default.nix b/plugins/by-name/multicursors/default.nix index 3cd98237..ef1b6a29 100644 --- a/plugins/by-name/multicursors/default.nix +++ b/plugins/by-name/multicursors/default.nix @@ -243,7 +243,7 @@ in extraPlugins = [ cfg.package ]; extraConfigLua = '' - require("multicursors").setup(${helpers.toLuaObject setupOptions}) + require("multicursors").setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/navbuddy/default.nix b/plugins/by-name/navbuddy/default.nix index 70b81b16..852cc52d 100644 --- a/plugins/by-name/navbuddy/default.nix +++ b/plugins/by-name/navbuddy/default.nix @@ -267,7 +267,7 @@ in extraConfigLua = '' local actions = require("nvim-navbuddy.actions") - require('nvim-navbuddy').setup(${helpers.toLuaObject setupOptions}) + require('nvim-navbuddy').setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/neo-tree/default.nix b/plugins/by-name/neo-tree/default.nix index c9f45477..d8d36285 100644 --- a/plugins/by-name/neo-tree/default.nix +++ b/plugins/by-name/neo-tree/default.nix @@ -1136,7 +1136,7 @@ in ]; extraConfigLua = '' - require('neo-tree').setup(${helpers.toLuaObject setupOptions}) + require('neo-tree').setup(${lib.nixvim.toLuaObject setupOptions}) ''; extraPackages = [ cfg.gitPackage ]; diff --git a/plugins/by-name/neogen/default.nix b/plugins/by-name/neogen/default.nix index 6a0198f8..8b2d87d9 100644 --- a/plugins/by-name/neogen/default.nix +++ b/plugins/by-name/neogen/default.nix @@ -202,7 +202,7 @@ in extraPlugins = [ cfg.package ]; extraConfigLua = '' - require("neogen").setup(${helpers.toLuaObject setupOptions}) + require("neogen").setup(${lib.nixvim.toLuaObject setupOptions}) ''; keymaps = flatten ( diff --git a/plugins/by-name/nix-develop/default.nix b/plugins/by-name/nix-develop/default.nix index 2adb022c..1ed4ec5f 100644 --- a/plugins/by-name/nix-develop/default.nix +++ b/plugins/by-name/nix-develop/default.nix @@ -47,12 +47,12 @@ in config = mkIf cfg.enable { extraPlugins = [ cfg.package ]; extraConfigLua = '' - local __ignored_variables = ${helpers.toLuaObject cfg.ignoredVariables} + local __ignored_variables = ${lib.nixvim.toLuaObject cfg.ignoredVariables} for ignoredVariable, shouldIgnore in ipairs(__ignored_variables) do require("nix-develop").ignored_variables[ignoredVariable] = shouldIgnore end - local __separated_variables = ${helpers.toLuaObject cfg.separatedVariables} + local __separated_variables = ${lib.nixvim.toLuaObject cfg.separatedVariables} for variable, separator in ipairs(__separated_variables) do require("nix-develop").separated_variables[variable] = separator end diff --git a/plugins/by-name/notify/default.nix b/plugins/by-name/notify/default.nix index 6b9dd6d9..5b910ec3 100644 --- a/plugins/by-name/notify/default.nix +++ b/plugins/by-name/notify/default.nix @@ -125,7 +125,7 @@ in extraConfigLua = '' vim.notify = require('notify'); - require('notify').setup(${helpers.toLuaObject setupOptions}) + require('notify').setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/nvim-bqf/default.nix b/plugins/by-name/nvim-bqf/default.nix index 2e0a0bc2..d203a37f 100644 --- a/plugins/by-name/nvim-bqf/default.nix +++ b/plugins/by-name/nvim-bqf/default.nix @@ -164,7 +164,7 @@ in extraPlugins = [ cfg.package ]; extraConfigLua = '' - require('bqf').setup(${helpers.toLuaObject options}) + require('bqf').setup(${lib.nixvim.toLuaObject options}) ''; }; } diff --git a/plugins/by-name/nvim-jdtls/default.nix b/plugins/by-name/nvim-jdtls/default.nix index 641828d3..fe831ba8 100644 --- a/plugins/by-name/nvim-jdtls/default.nix +++ b/plugins/by-name/nvim-jdtls/default.nix @@ -143,7 +143,7 @@ in pattern = "java"; callback.__raw = '' function () - require('jdtls').start_or_attach(${helpers.toLuaObject options}) + require('jdtls').start_or_attach(${lib.nixvim.toLuaObject options}) end ''; } diff --git a/plugins/by-name/nvim-osc52/default.nix b/plugins/by-name/nvim-osc52/default.nix index 9861a08f..33aa0b9a 100644 --- a/plugins/by-name/nvim-osc52/default.nix +++ b/plugins/by-name/nvim-osc52/default.nix @@ -117,7 +117,7 @@ with lib; ]; extraConfigLua = '' - require('osc52').setup(${helpers.toLuaObject setupOptions}) + require('osc52').setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/nvim-tree/default.nix b/plugins/by-name/nvim-tree/default.nix index 8dc3f01e..b14c726f 100644 --- a/plugins/by-name/nvim-tree/default.nix +++ b/plugins/by-name/nvim-tree/default.nix @@ -1113,7 +1113,7 @@ in -- Will automatically open the tree when running setup if startup buffer is a directory, -- is empty or is unnamed. nvim-tree window will be focused. - local open_on_setup = ${helpers.toLuaObject cfg.openOnSetup} + local open_on_setup = ${lib.nixvim.toLuaObject cfg.openOnSetup} if (directory or no_name) and open_on_setup then -- change to the directory @@ -1131,7 +1131,7 @@ in -- Will automatically open the tree when running setup if startup buffer is a file. -- File window will be focused. -- File will be found if updateFocusedFile is enabled. - local open_on_setup_file = ${helpers.toLuaObject cfg.openOnSetupFile} + local open_on_setup_file = ${lib.nixvim.toLuaObject cfg.openOnSetupFile} -- buffer is a real file on the disk local real_file = vim.fn.filereadable(data.file) == 1 @@ -1140,7 +1140,7 @@ in -- skip ignored filetypes local filetype = vim.bo[data.buf].ft - local ignored_filetypes = ${helpers.toLuaObject cfg.ignoreFtOnSetup} + local ignored_filetypes = ${lib.nixvim.toLuaObject cfg.ignoreFtOnSetup} if not vim.tbl_contains(ignored_filetypes, filetype) then -- open the tree but don't focus it @@ -1152,7 +1152,7 @@ in ------------------------------------------------------------------------------------------ -- Will ignore the buffer, when deciding to open the tree on setup. - local ignore_buffer_on_setup = ${helpers.toLuaObject cfg.ignoreBufferOnSetup} + local ignore_buffer_on_setup = ${lib.nixvim.toLuaObject cfg.ignoreBufferOnSetup} if ignore_buffer_on_setup then require("nvim-tree.api").tree.open() end @@ -1189,7 +1189,7 @@ in (optionalString autoOpenEnabled openNvimTreeFunction) + '' - require('nvim-tree').setup(${helpers.toLuaObject setupOptions}) + require('nvim-tree').setup(${lib.nixvim.toLuaObject setupOptions}) ''; extraPackages = [ cfg.gitPackage ]; diff --git a/plugins/by-name/ollama/default.nix b/plugins/by-name/ollama/default.nix index a4e8b495..49bbcf1a 100644 --- a/plugins/by-name/ollama/default.nix +++ b/plugins/by-name/ollama/default.nix @@ -226,7 +226,7 @@ in // cfg.extraOptions; in '' - require('ollama').setup(${helpers.toLuaObject setupOptions}) + require('ollama').setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/persistence/default.nix b/plugins/by-name/persistence/default.nix index fb426c15..e34ffb75 100644 --- a/plugins/by-name/persistence/default.nix +++ b/plugins/by-name/persistence/default.nix @@ -73,7 +73,7 @@ with lib; }; in '' - require('persistence').setup(${helpers.toLuaObject opts}) + require('persistence').setup(${lib.nixvim.toLuaObject opts}) ''; }; } diff --git a/plugins/by-name/presence-nvim/default.nix b/plugins/by-name/presence-nvim/default.nix index 02285c3b..f4da602c 100644 --- a/plugins/by-name/presence-nvim/default.nix +++ b/plugins/by-name/presence-nvim/default.nix @@ -212,7 +212,7 @@ in mkIf cfg.enable { extraPlugins = [ cfg.package ]; extraConfigLua = '' - require("presence").setup${helpers.toLuaObject setupOptions} + require("presence").setup${lib.nixvim.toLuaObject setupOptions} ''; }; } diff --git a/plugins/by-name/schemastore/default.nix b/plugins/by-name/schemastore/default.nix index df10aac4..1e8ad28f 100644 --- a/plugins/by-name/schemastore/default.nix +++ b/plugins/by-name/schemastore/default.nix @@ -136,7 +136,7 @@ lib.nixvim.vim-plugin.mkVimPlugin { plugins.lsp.servers = { jsonls.settings = mkIf cfg.json.enable { schemas.__raw = '' - require('schemastore').json.schemas(${helpers.toLuaObject cfg.json.settings}) + require('schemastore').json.schemas(${lib.nixvim.toLuaObject cfg.json.settings}) ''; # The plugin recommends to enable this option in its README. @@ -155,7 +155,7 @@ lib.nixvim.vim-plugin.mkVimPlugin { }; schemas.__raw = '' - require('schemastore').yaml.schemas(${helpers.toLuaObject cfg.yaml.settings}) + require('schemastore').yaml.schemas(${lib.nixvim.toLuaObject cfg.yaml.settings}) ''; }; }; diff --git a/plugins/by-name/spider/default.nix b/plugins/by-name/spider/default.nix index 5867f144..16c37f67 100644 --- a/plugins/by-name/spider/default.nix +++ b/plugins/by-name/spider/default.nix @@ -74,7 +74,7 @@ in keymaps = mappings; extraConfigLua = '' - require("${pluginName}").setup(${helpers.toLuaObject setupOptions}) + require("${pluginName}").setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/startup/default.nix b/plugins/by-name/startup/default.nix index 68935d4c..1c5a0ede 100644 --- a/plugins/by-name/startup/default.nix +++ b/plugins/by-name/startup/default.nix @@ -334,10 +334,10 @@ in } // sections; in '' - require('startup').setup(${helpers.toLuaObject setupOptions}) + require('startup').setup(${lib.nixvim.toLuaObject setupOptions}) '' + (optionalString ( cfg.userMappings != { } - ) "require('startup').create_mappings(${helpers.toLuaObject cfg.userMappings})"); + ) "require('startup').create_mappings(${lib.nixvim.toLuaObject cfg.userMappings})"); }; } diff --git a/plugins/by-name/treesitter/default.nix b/plugins/by-name/treesitter/default.nix index d2cc76c6..d6ab8f40 100644 --- a/plugins/by-name/treesitter/default.nix +++ b/plugins/by-name/treesitter/default.nix @@ -432,14 +432,14 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { # NOTE: Upstream state that the parser MUST be at the beginning of runtimepath. # Otherwise the parsers from Neovim takes precedent, which may be incompatible with some queries. (optionalString (cfg.settings.parser_install_dir != null) '' - vim.opt.runtimepath:prepend(${helpers.toLuaObject cfg.settings.parser_install_dir}) + vim.opt.runtimepath:prepend(${lib.nixvim.toLuaObject cfg.settings.parser_install_dir}) '') + '' - require('nvim-treesitter.configs').setup(${helpers.toLuaObject cfg.settings}) + require('nvim-treesitter.configs').setup(${lib.nixvim.toLuaObject cfg.settings}) '' + (optionalString (cfg.languageRegister != { }) '' do - local __parserFiletypeMappings = ${helpers.toLuaObject cfg.languageRegister} + local __parserFiletypeMappings = ${lib.nixvim.toLuaObject cfg.languageRegister} for parser_name, ft in pairs(__parserFiletypeMappings) do require('vim.treesitter.language').register(parser_name, ft) diff --git a/plugins/by-name/ts-context-commentstring/default.nix b/plugins/by-name/ts-context-commentstring/default.nix index 7f0cdd6d..8c8c4415 100644 --- a/plugins/by-name/ts-context-commentstring/default.nix +++ b/plugins/by-name/ts-context-commentstring/default.nix @@ -58,7 +58,7 @@ with lib; setupOptions = with cfg; { inherit languages; } // cfg.extraOptions; in '' - require('ts_context_commentstring').setup(${helpers.toLuaObject setupOptions}) + require('ts_context_commentstring').setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/wilder/default.nix b/plugins/by-name/wilder/default.nix index d245b38f..5c4aca74 100644 --- a/plugins/by-name/wilder/default.nix +++ b/plugins/by-name/wilder/default.nix @@ -260,9 +260,9 @@ in extraConfigLua = '' wilder = require("wilder") - wilder.setup(${helpers.toLuaObject setupOptions}) + wilder.setup(${lib.nixvim.toLuaObject setupOptions}) - local __wilderOptions = ${helpers.toLuaObject options} + local __wilderOptions = ${lib.nixvim.toLuaObject options} for key, value in pairs(__wilderOptions) do wilder.set_option(key, value) end diff --git a/plugins/by-name/wtf/default.nix b/plugins/by-name/wtf/default.nix index 585d588e..d79e2339 100644 --- a/plugins/by-name/wtf/default.nix +++ b/plugins/by-name/wtf/default.nix @@ -135,7 +135,7 @@ in keymaps = filter (keymap: keymap != null) (attrValues cfg.keymaps); extraConfigLua = '' - require("wtf").setup(${helpers.toLuaObject setupOptions}) + require("wtf").setup(${lib.nixvim.toLuaObject setupOptions}) ''; }; } diff --git a/plugins/by-name/yanky/default.nix b/plugins/by-name/yanky/default.nix index 4a5eacbf..0762a05d 100644 --- a/plugins/by-name/yanky/default.nix +++ b/plugins/by-name/yanky/default.nix @@ -378,7 +378,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { local utils = require('yanky.utils') ${optionalString config.plugins.telescope.enable "local mapping = require('yanky.telescope.mapping')"} - require('yanky').setup(${helpers.toLuaObject cfg.settings}) + require('yanky').setup(${lib.nixvim.toLuaObject cfg.settings}) end ''; diff --git a/plugins/lsp/default.nix b/plugins/lsp/default.nix index c32a78a1..90a563c9 100644 --- a/plugins/lsp/default.nix +++ b/plugins/lsp/default.nix @@ -176,7 +176,7 @@ in server: let updates = lib.concatMapStringsSep "\n" (name: '' - client.server_capabilities.${name} = ${helpers.toLuaObject server.capabilities.${name}} + client.server_capabilities.${name} = ${lib.nixvim.toLuaObject server.capabilities.${name}} '') (builtins.attrNames server.capabilities); in '' @@ -230,7 +230,7 @@ in do ${cfg.preConfig} - local __lspServers = ${helpers.toLuaObject cfg.enabledServers} + local __lspServers = ${lib.nixvim.toLuaObject cfg.enabledServers} -- Adding lspOnAttach function to nixvim module lua table so other plugins can hook into it. _M.lspOnAttach = function(client, bufnr) ${updateCapabilities} diff --git a/plugins/pluginmanagers/lazy.nix b/plugins/pluginmanagers/lazy.nix index dc6ecb55..c35bfe46 100644 --- a/plugins/pluginmanagers/lazy.nix +++ b/plugins/pluginmanagers/lazy.nix @@ -216,7 +216,7 @@ in patterns = {"."}, fallback = false }, - spec = ${helpers.toLuaObject packedPlugins} + spec = ${lib.nixvim.toLuaObject packedPlugins} } ) ''; diff --git a/plugins/pluginmanagers/packer.nix b/plugins/pluginmanagers/packer.nix index 3ea80612..513c8be5 100644 --- a/plugins/pluginmanagers/packer.nix +++ b/plugins/pluginmanagers/packer.nix @@ -183,11 +183,11 @@ in luaRockPlugins = luaRockListToLua cfg.rockPlugins; luaRocksString = optionalString ( cfg.rockPlugins != [ ] - ) "use_rocks ${helpers.toLuaObject luaRockPlugins}"; + ) "use_rocks ${lib.nixvim.toLuaObject luaRockPlugins}"; in mkIf (cfg.plugins != [ ]) '' require('packer').startup(function() - use ${helpers.toLuaObject packedPlugins} + use ${lib.nixvim.toLuaObject packedPlugins} ${luaRocksString} end) ''; diff --git a/tests/lib-tests.nix b/tests/lib-tests.nix index dee7dfe3..c719b170 100644 --- a/tests/lib-tests.nix +++ b/tests/lib-tests.nix @@ -50,7 +50,7 @@ let results = lib.runTests { testToLuaObject = { - expr = helpers.toLuaObject { + expr = lib.nixvim.toLuaObject { foo = "bar"; qux = [ 1 @@ -62,22 +62,22 @@ let }; testToLuaObjectRawLua = { - expr = helpers.toLuaObject { __raw = ""; }; + expr = lib.nixvim.toLuaObject { __raw = ""; }; expected = ""; }; testToLuaObjectInlineLua = { - expr = helpers.toLuaObject (lib.generators.mkLuaInline ""); + expr = lib.nixvim.toLuaObject (lib.generators.mkLuaInline ""); expected = "()"; }; testToLuaObjectInlineLuaNested = { - expr = helpers.toLuaObject { lua = lib.generators.mkLuaInline ""; }; + expr = lib.nixvim.toLuaObject { lua = lib.generators.mkLuaInline ""; }; expected = "{ lua = () }"; }; testToLuaObjectLuaTableMixingList = { - expr = helpers.toLuaObject { + expr = lib.nixvim.toLuaObject { "__unkeyed...." = "foo"; bar = "baz"; }; @@ -85,7 +85,7 @@ let }; testToLuaObjectNestedAttrs = { - expr = helpers.toLuaObject { + expr = lib.nixvim.toLuaObject { a = { b = 1; c = 2; @@ -98,7 +98,7 @@ let }; testToLuaObjectNestedList = { - expr = helpers.toLuaObject [ + expr = lib.nixvim.toLuaObject [ 1 2 [ @@ -115,7 +115,7 @@ let }; testToLuaObjectNonStringPrims = { - expr = helpers.toLuaObject { + expr = lib.nixvim.toLuaObject { a = 1.0; b = 2; c = true; @@ -126,24 +126,24 @@ let }; testToLuaObjectNilPrim = { - expr = helpers.toLuaObject null; + expr = lib.nixvim.toLuaObject null; expected = "nil"; }; testToLuaObjectStringPrim = { - expr = helpers.toLuaObject '' + expr = lib.nixvim.toLuaObject '' foo\bar baz''; expected = ''"foo\\bar\nbaz"''; }; testToLuaObjectDerivation = { - expr = helpers.toLuaObject drv; + expr = lib.nixvim.toLuaObject drv; expected = ''"${drv}"''; }; testToLuaObjectDerivationNested = { - expr = helpers.toLuaObject { + expr = lib.nixvim.toLuaObject { a = drv; b = { c = drv; @@ -155,7 +155,7 @@ let }; testToLuaObjectFilters = { - expr = helpers.toLuaObject { + expr = lib.nixvim.toLuaObject { a = null; b = { }; c = [ ]; @@ -168,7 +168,7 @@ let }; testToLuaObjectAttrListFilters = { - expr = helpers.toLuaObject { + expr = lib.nixvim.toLuaObject { a = null; b = { }; c = [ ]; @@ -217,7 +217,7 @@ let }; testToLuaObjectEmptyTable = { - expr = helpers.toLuaObject { + expr = lib.nixvim.toLuaObject { a = null; b = { }; c = {