diff --git a/modules/assistant/copilot/config.nix b/modules/assistant/copilot/config.nix index 30cf018..18f540d 100644 --- a/modules/assistant/copilot/config.nix +++ b/modules/assistant/copilot/config.nix @@ -4,6 +4,7 @@ lib, ... }: let + inherit (builtins) toJSON; inherit (lib) mkIf nvim mkLuaBinding mkMerge; cfg = config.vim.assistant.copilot; @@ -13,7 +14,7 @@ local s, _ = pcall(${luaFunction}) if not s then - local termcode = vim.api.nvim_replace_termcodes(${builtins.toJSON key}, true, false, true) + local termcode = vim.api.nvim_replace_termcodes(${toJSON key}, true, false, true) vim.fn.feedkeys(termcode, 'n') end diff --git a/modules/assistant/tabnine/config.nix b/modules/assistant/tabnine/config.nix index 21ad500..e9cc209 100644 --- a/modules/assistant/tabnine/config.nix +++ b/modules/assistant/tabnine/config.nix @@ -3,6 +3,7 @@ lib, ... }: let + inherit (builtins) toJSON; inherit (lib) mkIf mkMerge mkExprBinding boolToString nvim; cfg = config.vim.assistant.tabnine; @@ -17,7 +18,7 @@ in { local completion = require("tabnine.completion") if not state.completions_cache then - return "${builtins.toJSON cfg.mappings.accept}" + return "${toJSON cfg.mappings.accept}" end vim.schedule(completion.accept) @@ -29,7 +30,7 @@ in { local completion = require("tabnine.completion") if not state.completions_cache then - return "${builtins.toJSON cfg.mappings.dismiss}" + return "${toJSON cfg.mappings.dismiss}" end vim.schedule(function() diff --git a/modules/basic/config.nix b/modules/basic/config.nix index e84df7d..270f8ae 100644 --- a/modules/basic/config.nix +++ b/modules/basic/config.nix @@ -3,6 +3,7 @@ config, ... }: let + inherit (builtins) concatStringsSep; inherit (lib) optionalString mkIf nvim; cfg = config.vim; @@ -141,7 +142,7 @@ in { ''} ${optionalString cfg.spellChecking.enable '' set spell - set spelllang=${builtins.concatStringsSep "," cfg.spellChecking.languages}${optionalString cfg.spellChecking.enableProgrammingWordList ",programming"} + set spelllang=${concatStringsSep "," cfg.spellChecking.languages}${optionalString cfg.spellChecking.enableProgrammingWordList ",programming"} ''} ${optionalString (cfg.leaderKey != null) '' let mapleader = "${toString cfg.leaderKey}" diff --git a/modules/completion/nvim-cmp/config.nix b/modules/completion/nvim-cmp/config.nix index e9860b5..b20f71b 100644 --- a/modules/completion/nvim-cmp/config.nix +++ b/modules/completion/nvim-cmp/config.nix @@ -3,7 +3,9 @@ config, ... }: let - inherit (lib) addDescriptionsToMappings concatMapStringsSep attrNames concatStringsSep mapAttrsToList nvim mkIf mkSetLuaBinding mkMerge optionalString; + inherit (builtins) toJSON; + inherit (lib) addDescriptionsToMappings concatMapStringsSep attrNames concatStringsSep mapAttrsToList mkIf mkSetLuaBinding mkMerge optionalString; + inherit (lib.nvim) dag; cfg = config.vim.autocomplete; lspkindEnabled = config.vim.lsp.enable && config.vim.lsp.lspkind.enable; @@ -31,8 +33,8 @@ dagPlacement = if lspkindEnabled - then nvim.dag.entryAfter ["lspkind"] - else nvim.dag.entryAnywhere; + then dag.entryAfter ["lspkind"] + else dag.entryAnywhere; in { config = mkIf cfg.enable { vim.startPlugins = [ @@ -59,7 +61,7 @@ in { (mkSetLuaBinding mappings.confirm '' function() if not require('cmp').confirm({ select = true }) then - local termcode = vim.api.nvim_replace_termcodes(${builtins.toJSON mappings.confirm.value}, true, false, true) + local termcode = vim.api.nvim_replace_termcodes(${toJSON mappings.confirm.value}, true, false, true) vim.fn.feedkeys(termcode, 'n') end @@ -85,7 +87,7 @@ in { elseif has_words_before() then cmp.complete() else - local termcode = vim.api.nvim_replace_termcodes(${builtins.toJSON mappings.next.value}, true, false, true) + local termcode = vim.api.nvim_replace_termcodes(${toJSON mappings.next.value}, true, false, true) vim.fn.feedkeys(termcode, 'n') end @@ -152,7 +154,7 @@ in { elseif has_words_before() then cmp.complete() else - local termcode = vim.api.nvim_replace_termcodes(${builtins.toJSON mappings.next.value}, true, false, true) + local termcode = vim.api.nvim_replace_termcodes(${toJSON mappings.next.value}, true, false, true) vim.fn.feedkeys(termcode, 'n') end diff --git a/modules/core/default.nix b/modules/core/default.nix index 78eb89a..e4703b6 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -2,8 +2,8 @@ config, lib, ... -}: -with builtins; let +}: let + inherit (builtins) attrValues attrNames map mapAttrs toJSON isString concatStringsSep filter; inherit (lib) mkOption types mapAttrsFlatten filterAttrs optionalString getAttrs literalExpression; inherit (lib) nvim; inherit (nvim.lua) toLuaObject; @@ -84,7 +84,7 @@ with builtins; let else action.action; }; in - builtins.attrValues (builtins.mapAttrs + attrValues (mapAttrs (key: action: let normalizedAction = normalizeAction action; in { @@ -258,7 +258,7 @@ in { (filterNonNull cfg.globals); toLuaBindings = mode: maps: - builtins.map (value: '' + map (value: '' vim.keymap.set(${toLuaObject mode}, ${toLuaObject value.key}, ${toLuaObject value.action}, ${toLuaObject value.config}) '') (genMaps mode maps); @@ -282,7 +282,7 @@ in { }: let # When the value is a string, default it to dag.entryAnywhere finalDag = lib.mapAttrs (_: value: - if builtins.isString value + if isString value then nvim.dag.entryAnywhere value else value) dag; @@ -290,7 +290,7 @@ in { result = if sortedDag ? result then mapResult sortedDag.result - else abort ("Dependency cycle in ${name}: " + toJSON sortedConfig); + else abort ("Dependency cycle in ${name}: " + toJSON sortedDag); in result; in { diff --git a/modules/default.nix b/modules/default.nix index 53224c8..31cf87d 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -5,8 +5,8 @@ inputs: { check ? true, extraSpecialArgs ? {}, }: let - inherit (pkgs) wrapNeovim vimPlugins; inherit (builtins) map filter isString toString getAttr; + inherit (pkgs) wrapNeovim vimPlugins; inherit (pkgs.vimUtils) buildVimPlugin; extendedLib = import ../lib/stdlib-extended.nix lib; diff --git a/modules/git/config.nix b/modules/git/config.nix index 298fc9c..b22b48a 100644 --- a/modules/git/config.nix +++ b/modules/git/config.nix @@ -3,7 +3,9 @@ lib, ... }: let - inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetExprBinding toJSON mkSetLuaBinding nvim; + inherit (builtins) toJSON; + inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetExprBinding mkSetLuaBinding nvim; + cfg = config.vim.git; self = import ./git.nix {inherit lib;}; @@ -19,7 +21,7 @@ in { vim.maps.normal = mkMerge [ (mkSetExprBinding gsMappings.nextHunk '' function() - if vim.wo.diff then return ${builtins.toJSON gsMappings.nextHunk.value} end + if vim.wo.diff then return ${toJSON gsMappings.nextHunk.value} end vim.schedule(function() package.loaded.gitsigns.next_hunk() end) @@ -28,7 +30,7 @@ in { '') (mkSetExprBinding gsMappings.previousHunk '' function() - if vim.wo.diff then return ${builtins.toJSON gsMappings.previousHunk.value} end + if vim.wo.diff then return ${toJSON gsMappings.previousHunk.value} end vim.schedule(function() package.loaded.gitsigns.prev_hunk() end) @@ -69,7 +71,7 @@ in { vim.lsp.null-ls.sources.gitsigns-ca = '' table.insert( ls_sources, - null_ls.builtins.code_actions.gitsigns + null_ls.gcode_actions.gitsigns ) ''; }) diff --git a/modules/languages/bash/bash.nix b/modules/languages/bash/bash.nix index 2f3cf9b..243f30c 100644 --- a/modules/languages/bash/bash.nix +++ b/modules/languages/bash/bash.nix @@ -4,6 +4,7 @@ lib, ... }: let + inherit (builtins) attrNames; inherit (lib) mkOption mkEnableOption types isList nvim; cfg = config.vim.languages.bash; @@ -69,7 +70,7 @@ in { server = mkOption { description = "Bash LSP server to use"; - type = with types; enum (builtins.attrNames servers); + type = with types; enum (attrNames servers); default = defaultServer; }; @@ -89,7 +90,7 @@ in { }; type = mkOption { description = "Bash formatter to use"; - type = with types; enum (builtins.attrNames formats); + type = with types; enum (attrNames formats); default = defaultFormat; }; diff --git a/modules/languages/clang.nix b/modules/languages/clang.nix index 5e93dd0..ee40edf 100644 --- a/modules/languages/clang.nix +++ b/modules/languages/clang.nix @@ -4,6 +4,7 @@ lib, ... }: let + inherit (builtins) attrNames; inherit (lib) isList nvim optionalString mkEnableOption mkOption types mkIf mkMerge; cfg = config.vim.languages.clang; @@ -93,7 +94,7 @@ in { server = mkOption { description = "The clang LSP server to use"; - type = with types; enum (builtins.attrNames servers); + type = with types; enum (attrNames servers); default = defaultServer; }; @@ -119,7 +120,7 @@ in { }; debugger = mkOption { description = "clang debugger to use"; - type = with types; enum (builtins.attrNames debuggers); + type = with types; enum (attrNames debuggers); default = defaultDebugger; }; package = mkOption { diff --git a/modules/languages/dart/dart.nix b/modules/languages/dart/dart.nix index f76be78..c30f1f3 100644 --- a/modules/languages/dart/dart.nix +++ b/modules/languages/dart/dart.nix @@ -4,6 +4,7 @@ pkgs, ... }: let + inherit (builtins) attrNames; inherit (lib) isList nvim mkEnableOption mkOption types optionalString; cfg = config.vim.languages.dart; @@ -38,7 +39,7 @@ in { enable = mkEnableOption "Dart LSP support"; server = mkOption { description = "The Dart LSP server to use"; - type = with types; enum (builtins.attrNames servers); + type = with types; enum (attrNames servers); default = defaultServer; }; package = mkOption { diff --git a/modules/languages/go.nix b/modules/languages/go.nix index 3045669..8e3694c 100644 --- a/modules/languages/go.nix +++ b/modules/languages/go.nix @@ -4,6 +4,7 @@ lib, ... }: let + inherit (builtins) attrNames; inherit (lib) isList nvim getExe mkEnableOption mkOption types mkMerge mkIf; cfg = config.vim.languages.go; @@ -80,7 +81,7 @@ in { server = mkOption { description = "Go LSP server to use"; - type = with types; enum (builtins.attrNames servers); + type = with types; enum (attrNames servers); default = defaultServer; }; @@ -100,7 +101,7 @@ in { }; debugger = mkOption { description = "Go debugger to use"; - type = with types; enum (builtins.attrNames debuggers); + type = with types; enum (attrNames debuggers); default = defaultDebugger; }; package = mkOption { diff --git a/modules/languages/nix.nix b/modules/languages/nix.nix index 03b262d..e8b5578 100644 --- a/modules/languages/nix.nix +++ b/modules/languages/nix.nix @@ -4,6 +4,7 @@ lib, ... }: let + inherit (builtins) attrNames; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString; cfg = config.vim.languages.nix; @@ -146,7 +147,7 @@ in { type = mkOption { description = "Nix formatter to use"; - type = with types; enum (builtins.attrNames formats); + type = with types; enum (attrNames formats); default = defaultFormat; }; package = mkOption { diff --git a/modules/languages/php.nix b/modules/languages/php.nix index 8e4b03f..6a0071a 100644 --- a/modules/languages/php.nix +++ b/modules/languages/php.nix @@ -4,6 +4,7 @@ lib, ... }: let + inherit (builtins) attrNames; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge getExe; cfg = config.vim.languages.php; @@ -72,7 +73,7 @@ in { server = mkOption { description = "PHP LSP server to use"; - type = with types; enum (builtins.attrNames servers); + type = with types; enum (attrNames servers); default = defaultServer; }; diff --git a/modules/languages/python.nix b/modules/languages/python.nix index ac3a53e..970906f 100644 --- a/modules/languages/python.nix +++ b/modules/languages/python.nix @@ -4,6 +4,7 @@ lib, ... }: let + inherit (builtins) attrNames; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge getExe literalExpression; cfg = config.vim.languages.python; @@ -149,7 +150,7 @@ in { server = mkOption { description = "Python LSP server to use"; - type = with types; enum (builtins.attrNames servers); + type = with types; enum (attrNames servers); default = defaultServer; }; @@ -166,7 +167,7 @@ in { type = mkOption { description = "Python formatter to use"; - type = with types; enum (builtins.attrNames formats); + type = with types; enum (attrNames formats); default = defaultFormat; }; @@ -186,7 +187,7 @@ in { }; debugger = mkOption { description = "Python debugger to use"; - type = with types; enum (builtins.attrNames debuggers); + type = with types; enum (attrNames debuggers); default = defaultDebugger; }; package = mkOption { diff --git a/modules/languages/sql.nix b/modules/languages/sql.nix index dc5f564..83415ba 100644 --- a/modules/languages/sql.nix +++ b/modules/languages/sql.nix @@ -4,6 +4,7 @@ lib, ... }: let + inherit (builtins) attrNames; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge; cfg = config.vim.languages.sql; @@ -86,7 +87,7 @@ in { server = mkOption { description = "SQL LSP server to use"; - type = with types; enum (builtins.attrNames servers); + type = with types; enum (attrNames servers); default = defaultServer; }; @@ -103,7 +104,7 @@ in { type = mkOption { description = "SQL formatter to use"; - type = with types; enum (builtins.attrNames formats); + type = with types; enum (attrNames formats); default = defaultFormat; }; diff --git a/modules/languages/svelte.nix b/modules/languages/svelte.nix index 786b012..2c0d40e 100644 --- a/modules/languages/svelte.nix +++ b/modules/languages/svelte.nix @@ -4,6 +4,7 @@ lib, ... }: let + inherit (builtins) attrNames; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge; cfg = config.vim.languages.svelte; @@ -72,7 +73,7 @@ in { server = mkOption { description = "Svelte LSP server to use"; - type = with types; enum (builtins.attrNames servers); + type = with types; enum (attrNames servers); default = defaultServer; }; @@ -89,7 +90,7 @@ in { type = mkOption { description = "Svelte formatter to use"; - type = with types; enum (builtins.attrNames formats); + type = with types; enum (attrNames formats); default = defaultFormat; }; diff --git a/modules/languages/ts.nix b/modules/languages/ts.nix index b11141d..7fc1a24 100644 --- a/modules/languages/ts.nix +++ b/modules/languages/ts.nix @@ -4,6 +4,7 @@ lib, ... }: let + inherit (builtins) attrNames; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge; cfg = config.vim.languages.ts; @@ -98,7 +99,7 @@ in { server = mkOption { description = "Typescript/Javascript LSP server to use"; - type = with types; enum (builtins.attrNames servers); + type = with types; enum (attrNames servers); default = defaultServer; }; @@ -115,7 +116,7 @@ in { type = mkOption { description = "Typescript/Javascript formatter to use"; - type = with types; enum (builtins.attrNames formats); + type = with types; enum (attrNames formats); default = defaultFormat; }; diff --git a/modules/terminal/toggleterm/config.nix b/modules/terminal/toggleterm/config.nix index b115d32..eca6e60 100644 --- a/modules/terminal/toggleterm/config.nix +++ b/modules/terminal/toggleterm/config.nix @@ -3,6 +3,7 @@ lib, ... }: let + inherit (builtins) toJSON; inherit (lib) mkMerge mkIf mkBinding nvim getExe; cfg = config.vim.terminal.toggleterm; @@ -59,7 +60,7 @@ in { end }) - vim.keymap.set('n', ${builtins.toJSON cfg.lazygit.mappings.open}, function() lazygit:toggle() end, {silent = true, noremap = true, desc = 'Open lazygit [toggleterm]'}) + vim.keymap.set('n', ${toJSON cfg.lazygit.mappings.open}, function() lazygit:toggle() end, {silent = true, noremap = true, desc = 'Open lazygit [toggleterm]'}) ''; } ) diff --git a/modules/ui/breadcrumbs/config.nix b/modules/ui/breadcrumbs/config.nix index 0d988ca..22de56d 100644 --- a/modules/ui/breadcrumbs/config.nix +++ b/modules/ui/breadcrumbs/config.nix @@ -2,8 +2,7 @@ config, lib, ... -}: -with builtins; let +}: let inherit (lib) optionalString boolToString mkIf optionals; inherit (lib.nvim.lua) nullString;