From ffa25c8c8a636efd4b5e6062d089c7892bf8bb22 Mon Sep 17 00:00:00 2001 From: Frothy <76622149+FrothyMarrow@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:50:27 -0700 Subject: [PATCH] treewide: move from 'with lib' to 'inherit (lib) ...' --- modules/assistant/copilot/config.nix | 6 ++-- modules/assistant/copilot/copilot.nix | 6 ++-- modules/assistant/tabnine/config.nix | 6 ++-- modules/assistant/tabnine/tabnine.nix | 6 ++-- modules/autopairs/nvim-autopairs/config.nix | 6 ++-- .../nvim-autopairs/nvim-autopairs.nix | 6 ++-- .../comments/comment-nvim/comment-nvim.nix | 6 ++-- modules/comments/comment-nvim/config.nix | 6 ++-- modules/completion/nvim-cmp/config.nix | 6 ++-- modules/completion/nvim-cmp/nvim-cmp.nix | 6 ++-- modules/core/default.nix | 1 + modules/dashboard/alpha/alpha.nix | 6 ++-- modules/dashboard/alpha/config.nix | 6 ++-- modules/dashboard/dashboard-nvim/config.nix | 6 ++-- .../dashboard-nvim/dashboard-nvim.nix | 6 ++-- modules/dashboard/startify/config.nix | 6 ++-- modules/dashboard/startify/startify.nix | 6 ++-- modules/debugger/nvim-dap/config.nix | 6 ++-- modules/debugger/nvim-dap/nvim-dap.nix | 5 ++-- modules/filetree/nvimtree/config.nix | 6 ++-- modules/filetree/nvimtree/nvimtree.nix | 6 ++-- modules/git/config.nix | 9 +++--- modules/git/git.nix | 6 ++-- modules/minimap/codewindow/codewindow.nix | 5 ++-- modules/minimap/codewindow/config.nix | 6 ++-- modules/minimap/minimap-vim/config.nix | 6 ++-- modules/minimap/minimap-vim/minimap-vim.nix | 6 ++-- modules/notes/mind-nvim/config.nix | 6 ++-- modules/notes/mind-nvim/mind-nvim.nix | 6 ++-- modules/notes/obsidian/config.nix | 6 ++-- modules/notes/obsidian/obsidian.nix | 6 ++-- modules/notes/orgmode/config.nix | 6 ++-- modules/notes/orgmode/orgmode.nix | 6 ++-- modules/notes/todo-comments/config.nix | 6 ++-- modules/notes/todo-comments/todo-comments.nix | 6 ++-- modules/projects/project-nvim/config.nix | 6 ++-- .../projects/project-nvim/project-nvim.nix | 6 ++-- .../rich-presence/presence-nvim/config.nix | 6 ++-- .../presence-nvim/presence-nvim.nix | 6 ++-- .../session/nvim-session-manager/config.nix | 6 ++-- .../nvim-session-manager.nix | 6 ++-- modules/snippets/vsnip/config.nix | 6 ++-- modules/snippets/vsnip/vsnip.nix | 5 ++-- modules/statusline/lualine/config.nix | 29 +++++++++---------- modules/statusline/lualine/lualine.nix | 6 ++-- modules/tabline/nvim-bufferline/config.nix | 6 ++-- .../nvim-bufferline/nvim-bufferline.nix | 6 ++-- modules/terminal/toggleterm/config.nix | 8 ++--- modules/terminal/toggleterm/toggleterm.nix | 6 ++-- modules/theme/config.nix | 5 ++-- modules/theme/theme.nix | 7 ++--- modules/treesitter/config.nix | 6 ++-- modules/treesitter/context.nix | 6 ++-- modules/treesitter/treesitter.nix | 5 ++-- modules/ui/colorizer/colorizer.nix | 6 ++-- modules/ui/colorizer/config.nix | 6 ++-- modules/ui/illuminate/config.nix | 6 ++-- modules/ui/illuminate/illuminate.nix | 6 ++-- modules/ui/modes/config.nix | 6 ++-- modules/ui/modes/modes.nix | 6 ++-- modules/ui/noice/config.nix | 6 ++-- modules/ui/noice/noice.nix | 6 ++-- .../ui/notifications/nvim-notify/config.nix | 6 ++-- .../notifications/nvim-notify/nvim-notify.nix | 6 ++-- modules/ui/smartcolumn/config.nix | 6 ++-- modules/ui/smartcolumn/smartcolumn.nix | 6 ++-- .../utility/binds/cheatsheet/cheatsheet.nix | 6 ++-- modules/utility/binds/cheatsheet/config.nix | 6 ++-- modules/utility/binds/which-key/config.nix | 6 ++-- modules/utility/binds/which-key/which-key.nix | 6 ++-- modules/utility/ccc/ccc.nix | 6 ++-- modules/utility/ccc/config.nix | 6 ++-- modules/utility/diffview/config.nix | 6 ++-- modules/utility/diffview/diffview.nix | 6 ++-- .../utility/gestures/gesture-nvim/config.nix | 6 ++-- .../gestures/gesture-nvim/gesture-nvim.nix | 5 ++-- modules/utility/icon-picker/config.nix | 6 ++-- modules/utility/icon-picker/icon-picker.nix | 6 ++-- modules/utility/motion/hop/config.nix | 5 ++-- modules/utility/motion/hop/hop.nix | 5 ++-- modules/utility/motion/leap/config.nix | 5 ++-- modules/utility/motion/leap/leap.nix | 6 ++-- modules/utility/surround/config.nix | 6 ++-- modules/utility/surround/surround.nix | 6 ++-- modules/utility/telescope/config.nix | 6 ++-- modules/utility/telescope/telescope.nix | 6 ++-- modules/utility/wakatime/config.nix | 6 ++-- modules/utility/wakatime/vim-wakatime.nix | 6 ++-- modules/visuals/config.nix | 5 ++-- modules/visuals/visuals.nix | 6 ++-- 90 files changed, 281 insertions(+), 273 deletions(-) diff --git a/modules/assistant/copilot/config.nix b/modules/assistant/copilot/config.nix index 349d610..30cf018 100644 --- a/modules/assistant/copilot/config.nix +++ b/modules/assistant/copilot/config.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim mkLuaBinding mkMerge; + cfg = config.vim.assistant.copilot; wrapPanelBinding = luaFunction: key: '' diff --git a/modules/assistant/copilot/copilot.nix b/modules/assistant/copilot/copilot.nix index 927604c..8583869 100644 --- a/modules/assistant/copilot/copilot.nix +++ b/modules/assistant/copilot/copilot.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkEnableOption mkOption types; + cfg = config.vim.assistant.copilot; in { options.vim.assistant.copilot = { diff --git a/modules/assistant/tabnine/config.nix b/modules/assistant/tabnine/config.nix index b959495..21ad500 100644 --- a/modules/assistant/tabnine/config.nix +++ b/modules/assistant/tabnine/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf mkMerge mkExprBinding boolToString nvim; + cfg = config.vim.assistant.tabnine; in { config = mkIf cfg.enable { diff --git a/modules/assistant/tabnine/tabnine.nix b/modules/assistant/tabnine/tabnine.nix index 0682f79..949a6b1 100644 --- a/modules/assistant/tabnine/tabnine.nix +++ b/modules/assistant/tabnine/tabnine.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption mkOption types mkMappingOption; +in { options.vim.assistant.tabnine = { enable = mkEnableOption "Tabnine assistant"; diff --git a/modules/autopairs/nvim-autopairs/config.nix b/modules/autopairs/nvim-autopairs/config.nix index 59ad538..0aceca5 100644 --- a/modules/autopairs/nvim-autopairs/config.nix +++ b/modules/autopairs/nvim-autopairs/config.nix @@ -2,9 +2,9 @@ lib, config, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim optionalString boolToString; + cfg = config.vim.autopairs; in { config = diff --git a/modules/autopairs/nvim-autopairs/nvim-autopairs.nix b/modules/autopairs/nvim-autopairs/nvim-autopairs.nix index d64b5cb..330d118 100644 --- a/modules/autopairs/nvim-autopairs/nvim-autopairs.nix +++ b/modules/autopairs/nvim-autopairs/nvim-autopairs.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption mkOption types; +in { options.vim = { autopairs = { enable = mkEnableOption "autopairs" // {default = false;}; diff --git a/modules/comments/comment-nvim/comment-nvim.nix b/modules/comments/comment-nvim/comment-nvim.nix index 29646ac..13ca475 100644 --- a/modules/comments/comment-nvim/comment-nvim.nix +++ b/modules/comments/comment-nvim/comment-nvim.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption mkMappingOption; +in { options.vim.comments.comment-nvim = { enable = mkEnableOption "smart and powerful comment plugin for neovim comment-nvim"; diff --git a/modules/comments/comment-nvim/config.nix b/modules/comments/comment-nvim/config.nix index bc29111..ea2f1e1 100644 --- a/modules/comments/comment-nvim/config.nix +++ b/modules/comments/comment-nvim/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf mkMerge mkExprBinding mkBinding nvim; + cfg = config.vim.comments.comment-nvim; self = import ./comment-nvim.nix { inherit lib; diff --git a/modules/completion/nvim-cmp/config.nix b/modules/completion/nvim-cmp/config.nix index e7ab3ac..e9860b5 100644 --- a/modules/completion/nvim-cmp/config.nix +++ b/modules/completion/nvim-cmp/config.nix @@ -2,9 +2,9 @@ lib, config, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) addDescriptionsToMappings concatMapStringsSep attrNames concatStringsSep mapAttrsToList nvim mkIf mkSetLuaBinding mkMerge optionalString; + cfg = config.vim.autocomplete; lspkindEnabled = config.vim.lsp.enable && config.vim.lsp.lspkind.enable; diff --git a/modules/completion/nvim-cmp/nvim-cmp.nix b/modules/completion/nvim-cmp/nvim-cmp.nix index fb9be86..38c8619 100644 --- a/modules/completion/nvim-cmp/nvim-cmp.nix +++ b/modules/completion/nvim-cmp/nvim-cmp.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption mkMappingOption mkOption types; +in { options.vim = { autocomplete = { enable = mkEnableOption "enable autocomplete" // {default = false;}; diff --git a/modules/core/default.nix b/modules/core/default.nix index b0b9d80..78eb89a 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -7,6 +7,7 @@ with builtins; let inherit (lib) mkOption types mapAttrsFlatten filterAttrs optionalString getAttrs literalExpression; inherit (lib) nvim; inherit (nvim.lua) toLuaObject; + inherit (nvim.vim) valToVim; cfg = config.vim; diff --git a/modules/dashboard/alpha/alpha.nix b/modules/dashboard/alpha/alpha.nix index 48b8bfa..3c43e15 100644 --- a/modules/dashboard/alpha/alpha.nix +++ b/modules/dashboard/alpha/alpha.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption; +in { options.vim.dashboard.alpha = { enable = mkEnableOption "dashboard via alpha.nvim"; }; diff --git a/modules/dashboard/alpha/config.nix b/modules/dashboard/alpha/config.nix index a0df3be..a2ee14b 100644 --- a/modules/dashboard/alpha/config.nix +++ b/modules/dashboard/alpha/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim; + cfg = config.vim.dashboard.alpha; in { config = mkIf cfg.enable { diff --git a/modules/dashboard/dashboard-nvim/config.nix b/modules/dashboard/dashboard-nvim/config.nix index 14166f6..13c08e6 100644 --- a/modules/dashboard/dashboard-nvim/config.nix +++ b/modules/dashboard/dashboard-nvim/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim; + cfg = config.vim.dashboard.dashboard-nvim; in { config = mkIf cfg.enable { diff --git a/modules/dashboard/dashboard-nvim/dashboard-nvim.nix b/modules/dashboard/dashboard-nvim/dashboard-nvim.nix index 6823deb..78264ca 100644 --- a/modules/dashboard/dashboard-nvim/dashboard-nvim.nix +++ b/modules/dashboard/dashboard-nvim/dashboard-nvim.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption; +in { options.vim.dashboard.dashboard-nvim = { enable = mkEnableOption "dashboard via dashboard.nvim"; }; diff --git a/modules/dashboard/startify/config.nix b/modules/dashboard/startify/config.nix index c69d774..76308ac 100644 --- a/modules/dashboard/startify/config.nix +++ b/modules/dashboard/startify/config.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with builtins; -with lib; let +}: let + inherit (lib) mkIf; + cfg = config.vim.dashboard.startify; mkVimBool = val: diff --git a/modules/dashboard/startify/startify.nix b/modules/dashboard/startify/startify.nix index de208cd..36118f4 100644 --- a/modules/dashboard/startify/startify.nix +++ b/modules/dashboard/startify/startify.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with builtins; -with lib; { +}: let + inherit (lib) mkEnableOption mkOption types; +in { options.vim.dashboard.startify = { enable = mkEnableOption "dashboard via vim-startify"; diff --git a/modules/debugger/nvim-dap/config.nix b/modules/debugger/nvim-dap/config.nix index 874e1b6..db9558d 100644 --- a/modules/debugger/nvim-dap/config.nix +++ b/modules/debugger/nvim-dap/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) addDescriptionsToMappings mkMerge mkIf mapAttrs nvim mkSetLuaBinding optionalString; + cfg = config.vim.debugger.nvim-dap; self = import ./nvim-dap.nix { inherit lib; diff --git a/modules/debugger/nvim-dap/nvim-dap.nix b/modules/debugger/nvim-dap/nvim-dap.nix index 7e43264..ade007a 100644 --- a/modules/debugger/nvim-dap/nvim-dap.nix +++ b/modules/debugger/nvim-dap/nvim-dap.nix @@ -1,5 +1,6 @@ -{lib, ...}: -with lib; { +{lib, ...}: let + inherit (lib) mkEnableOption mkOption types mkMappingOption; +in { options.vim.debugger.nvim-dap = { enable = mkEnableOption "debugging via nvim-dap"; diff --git a/modules/filetree/nvimtree/config.nix b/modules/filetree/nvimtree/config.nix index 79ae21f..5f11c5a 100644 --- a/modules/filetree/nvimtree/config.nix +++ b/modules/filetree/nvimtree/config.nix @@ -3,9 +3,9 @@ lib, pkgs, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf mkMerge mkBinding nvim boolToString; + cfg = config.vim.filetree.nvimTree; self = import ./nvimtree.nix { inherit pkgs; diff --git a/modules/filetree/nvimtree/nvimtree.nix b/modules/filetree/nvimtree/nvimtree.nix index f329328..3e68f8a 100644 --- a/modules/filetree/nvimtree/nvimtree.nix +++ b/modules/filetree/nvimtree/nvimtree.nix @@ -2,9 +2,9 @@ pkgs, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption mkOption types literalExpression; +in { options.vim.filetree.nvimTree = { enable = mkEnableOption "filetree via nvim-tree.lua"; diff --git a/modules/git/config.nix b/modules/git/config.nix index cda7279..298fc9c 100644 --- a/modules/git/config.nix +++ b/modules/git/config.nix @@ -2,9 +2,8 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetExprBinding toJSON mkSetLuaBinding nvim; cfg = config.vim.git; self = import ./git.nix {inherit lib;}; @@ -20,7 +19,7 @@ in { vim.maps.normal = mkMerge [ (mkSetExprBinding gsMappings.nextHunk '' function() - if vim.wo.diff then return ${toJSON gsMappings.nextHunk.value} end + if vim.wo.diff then return ${builtins.toJSON gsMappings.nextHunk.value} end vim.schedule(function() package.loaded.gitsigns.next_hunk() end) @@ -29,7 +28,7 @@ in { '') (mkSetExprBinding gsMappings.previousHunk '' function() - if vim.wo.diff then return ${toJSON gsMappings.previousHunk.value} end + if vim.wo.diff then return ${builtins.toJSON gsMappings.previousHunk.value} end vim.schedule(function() package.loaded.gitsigns.prev_hunk() end) diff --git a/modules/git/git.nix b/modules/git/git.nix index c9d059e..0447fc4 100644 --- a/modules/git/git.nix +++ b/modules/git/git.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption mkMappingOption; +in { options.vim.git = { enable = mkEnableOption "git tools via gitsigns"; diff --git a/modules/minimap/codewindow/codewindow.nix b/modules/minimap/codewindow/codewindow.nix index d67762b..551dd8e 100644 --- a/modules/minimap/codewindow/codewindow.nix +++ b/modules/minimap/codewindow/codewindow.nix @@ -1,5 +1,6 @@ -{lib, ...}: -with lib; { +{lib, ...}: let + inherit (lib) mkEnableOption mkMappingOption; +in { options.vim.minimap.codewindow = { enable = mkEnableOption "codewindow plugin for minimap view"; diff --git a/modules/minimap/codewindow/config.nix b/modules/minimap/codewindow/config.nix index ac82829..86b0137 100644 --- a/modules/minimap/codewindow/config.nix +++ b/modules/minimap/codewindow/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetLuaBinding nvim; + cfg = config.vim.minimap.codewindow; self = import ./codewindow.nix {inherit lib;}; diff --git a/modules/minimap/minimap-vim/config.nix b/modules/minimap/minimap-vim/config.nix index 15f1761..ef318f7 100644 --- a/modules/minimap/minimap-vim/config.nix +++ b/modules/minimap/minimap-vim/config.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf; + cfg = config.vim.minimap.minimap-vim; in { config = mkIf cfg.enable { diff --git a/modules/minimap/minimap-vim/minimap-vim.nix b/modules/minimap/minimap-vim/minimap-vim.nix index bd237aa..12f7f42 100644 --- a/modules/minimap/minimap-vim/minimap-vim.nix +++ b/modules/minimap/minimap-vim/minimap-vim.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption; +in { options.vim.minimap.minimap-vim = { enable = mkEnableOption "minimap-vim plugin for minimap view"; }; diff --git a/modules/notes/mind-nvim/config.nix b/modules/notes/mind-nvim/config.nix index 5e23f06..98f7751 100644 --- a/modules/notes/mind-nvim/config.nix +++ b/modules/notes/mind-nvim/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim; + cfg = config.vim.notes.mind-nvim; in { config = mkIf (cfg.enable) { diff --git a/modules/notes/mind-nvim/mind-nvim.nix b/modules/notes/mind-nvim/mind-nvim.nix index d9b069c..f0d43ea 100644 --- a/modules/notes/mind-nvim/mind-nvim.nix +++ b/modules/notes/mind-nvim/mind-nvim.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption; +in { options.vim.notes.mind-nvim = { enable = mkEnableOption "organizer tool for Neovim."; }; diff --git a/modules/notes/obsidian/config.nix b/modules/notes/obsidian/config.nix index 8f9c2d1..192244b 100644 --- a/modules/notes/obsidian/config.nix +++ b/modules/notes/obsidian/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim; + cfg = config.vim.notes.obsidian; auto = config.vim.autocomplete; in { diff --git a/modules/notes/obsidian/obsidian.nix b/modules/notes/obsidian/obsidian.nix index 60ee71f..cfc0eda 100644 --- a/modules/notes/obsidian/obsidian.nix +++ b/modules/notes/obsidian/obsidian.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption mkOption types; +in { options.vim.notes = { obsidian = { enable = mkEnableOption "complementary neovim plugins for Obsidian editor"; diff --git a/modules/notes/orgmode/config.nix b/modules/notes/orgmode/config.nix index 1dadb50..967a937 100644 --- a/modules/notes/orgmode/config.nix +++ b/modules/notes/orgmode/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf mkMerge nvim; + cfg = config.vim.notes.orgmode; in { config = mkIf cfg.enable (mkMerge [ diff --git a/modules/notes/orgmode/orgmode.nix b/modules/notes/orgmode/orgmode.nix index f31333d..d7fce12 100644 --- a/modules/notes/orgmode/orgmode.nix +++ b/modules/notes/orgmode/orgmode.nix @@ -3,9 +3,9 @@ lib, pkgs, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption types mkOption nvim; +in { options.vim.notes.orgmode = { enable = mkEnableOption "nvim-orgmode: Neovim plugin for Emac Orgmode. Get the best of both worlds"; diff --git a/modules/notes/todo-comments/config.nix b/modules/notes/todo-comments/config.nix index 3adb0f6..f1ced60 100644 --- a/modules/notes/todo-comments/config.nix +++ b/modules/notes/todo-comments/config.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkMerge mkBinding mkIf; + cfg = config.vim.notes.todo-comments; self = import ./todo-comments.nix {inherit lib;}; mappings = self.options.vim.notes.todo-comments.mappings; diff --git a/modules/notes/todo-comments/todo-comments.nix b/modules/notes/todo-comments/todo-comments.nix index 992a6c6..6fbc71b 100644 --- a/modules/notes/todo-comments/todo-comments.nix +++ b/modules/notes/todo-comments/todo-comments.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption mkOption types mkMappingOption; +in { options.vim.notes.todo-comments = { enable = mkEnableOption "todo-comments: highlight and search for todo comments like TODO, HACK, BUG in your code base"; diff --git a/modules/projects/project-nvim/config.nix b/modules/projects/project-nvim/config.nix index d78e10f..6fc78e4 100644 --- a/modules/projects/project-nvim/config.nix +++ b/modules/projects/project-nvim/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim boolToString concatStringsSep; + cfg = config.vim.projects.project-nvim; in { config = mkIf cfg.enable { diff --git a/modules/projects/project-nvim/project-nvim.nix b/modules/projects/project-nvim/project-nvim.nix index 1e3fb8b..5811f96 100644 --- a/modules/projects/project-nvim/project-nvim.nix +++ b/modules/projects/project-nvim/project-nvim.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption mkOption types; +in { options.vim.projects.project-nvim = { enable = mkEnableOption "project-nvim for project management"; diff --git a/modules/rich-presence/presence-nvim/config.nix b/modules/rich-presence/presence-nvim/config.nix index 493853c..452af4f 100644 --- a/modules/rich-presence/presence-nvim/config.nix +++ b/modules/rich-presence/presence-nvim/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim boolToString; + cfg = config.vim.presence.presence-nvim; in { config = mkIf cfg.enable { diff --git a/modules/rich-presence/presence-nvim/presence-nvim.nix b/modules/rich-presence/presence-nvim/presence-nvim.nix index b7acf48..911ff2b 100644 --- a/modules/rich-presence/presence-nvim/presence-nvim.nix +++ b/modules/rich-presence/presence-nvim/presence-nvim.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption mkOption types; +in { options.vim.presence.presence-nvim = { enable = mkEnableOption "presence.nvim plugin for discord rich presence"; diff --git a/modules/session/nvim-session-manager/config.nix b/modules/session/nvim-session-manager/config.nix index a65b21f..70ed26b 100644 --- a/modules/session/nvim-session-manager/config.nix +++ b/modules/session/nvim-session-manager/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf optionals mkMerge mkBinding nvim concatStringsSep boolToString; + cfg = config.vim.session.nvim-session-manager; in { config = mkIf cfg.enable { diff --git a/modules/session/nvim-session-manager/nvim-session-manager.nix b/modules/session/nvim-session-manager/nvim-session-manager.nix index 881a6ae..a5395a0 100644 --- a/modules/session/nvim-session-manager/nvim-session-manager.nix +++ b/modules/session/nvim-session-manager/nvim-session-manager.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption mkOption types; +in { options.vim.session.nvim-session-manager = { enable = mkEnableOption "nvim-session-manager: manage sessions like folders in VSCode"; diff --git a/modules/snippets/vsnip/config.nix b/modules/snippets/vsnip/config.nix index bf76d55..fd4bf50 100644 --- a/modules/snippets/vsnip/config.nix +++ b/modules/snippets/vsnip/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf; + cfg = config.vim.snippets.vsnip; in { config = mkIf cfg.enable { diff --git a/modules/snippets/vsnip/vsnip.nix b/modules/snippets/vsnip/vsnip.nix index c59a5d6..2d423cb 100644 --- a/modules/snippets/vsnip/vsnip.nix +++ b/modules/snippets/vsnip/vsnip.nix @@ -1,5 +1,6 @@ -{lib, ...}: -with lib; { +{lib, ...}: let + inherit (lib) mkEnableOption; +in { options.vim.snippets.vsnip = { enable = mkEnableOption "vim-vsnip: snippet LSP/VSCode's format"; }; diff --git a/modules/statusline/lualine/config.nix b/modules/statusline/lualine/config.nix index 53cf3fd..bf33e13 100644 --- a/modules/statusline/lualine/config.nix +++ b/modules/statusline/lualine/config.nix @@ -2,10 +2,9 @@ config, lib, ... -}: -with lib; let +}: let cfg = config.vim.statusline.lualine; - inherit (nvim.lua) luaTable; + inherit (lib) mkIf nvim boolToString optionalString; in { config = (mkIf cfg.enable) { vim.startPlugins = [ @@ -33,21 +32,21 @@ in { }, -- active sections sections = { - lualine_a = ${luaTable (cfg.activeSection.a ++ cfg.extraActiveSection.a)}, - lualine_b = ${luaTable (cfg.activeSection.b ++ cfg.extraActiveSection.b)}, - lualine_c = ${luaTable (cfg.activeSection.c ++ cfg.extraActiveSection.c)}, - lualine_x = ${luaTable (cfg.activeSection.x ++ cfg.extraActiveSection.x)}, - lualine_y = ${luaTable (cfg.activeSection.y ++ cfg.extraActiveSection.y)}, - lualine_z = ${luaTable (cfg.activeSection.z ++ cfg.extraActiveSection.z)}, + lualine_a = ${nvim.lua.luaTable (cfg.activeSection.a ++ cfg.extraActiveSection.a)}, + lualine_b = ${nvim.lua.luaTable (cfg.activeSection.b ++ cfg.extraActiveSection.b)}, + lualine_c = ${nvim.lua.luaTable (cfg.activeSection.c ++ cfg.extraActiveSection.c)}, + lualine_x = ${nvim.lua.luaTable (cfg.activeSection.x ++ cfg.extraActiveSection.x)}, + lualine_y = ${nvim.lua.luaTable (cfg.activeSection.y ++ cfg.extraActiveSection.y)}, + lualine_z = ${nvim.lua.luaTable (cfg.activeSection.z ++ cfg.extraActiveSection.z)}, }, -- inactive_sections = { - lualine_a = ${luaTable (cfg.inactiveSection.a ++ cfg.extraInactiveSection.a)}, - lualine_b = ${luaTable (cfg.inactiveSection.b ++ cfg.extraInactiveSection.b)}, - lualine_c = ${luaTable (cfg.inactiveSection.c ++ cfg.extraInactiveSection.c)}, - lualine_x = ${luaTable (cfg.inactiveSection.x ++ cfg.extraInactiveSection.x)}, - lualine_y = ${luaTable (cfg.inactiveSection.y ++ cfg.extraInactiveSection.y)}, - lualine_z = ${luaTable (cfg.inactiveSection.z ++ cfg.extraInactiveSection.z)}, + lualine_a = ${nvim.lua.luaTable (cfg.inactiveSection.a ++ cfg.extraInactiveSection.a)}, + lualine_b = ${nvim.lua.luaTable (cfg.inactiveSection.b ++ cfg.extraInactiveSection.b)}, + lualine_c = ${nvim.lua.luaTable (cfg.inactiveSection.c ++ cfg.extraInactiveSection.c)}, + lualine_x = ${nvim.lua.luaTable (cfg.inactiveSection.x ++ cfg.extraInactiveSection.x)}, + lualine_y = ${nvim.lua.luaTable (cfg.inactiveSection.y ++ cfg.extraInactiveSection.y)}, + lualine_z = ${nvim.lua.luaTable (cfg.inactiveSection.z ++ cfg.extraInactiveSection.z)}, }, tabline = {}, diff --git a/modules/statusline/lualine/lualine.nix b/modules/statusline/lualine/lualine.nix index c953fe2..f3c4306 100644 --- a/modules/statusline/lualine/lualine.nix +++ b/modules/statusline/lualine/lualine.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkEnableOption mkOption types elem optional; + supported_themes = import ./supported_themes.nix; colorPuccin = if config.vim.statusline.lualine.theme == "catppuccin" diff --git a/modules/tabline/nvim-bufferline/config.nix b/modules/tabline/nvim-bufferline/config.nix index 05c6399..9004c89 100644 --- a/modules/tabline/nvim-bufferline/config.nix +++ b/modules/tabline/nvim-bufferline/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf mkMerge mkLuaBinding mkBinding nvim; + cfg = config.vim.tabline.nvimBufferline; self = import ./nvim-bufferline.nix { inherit lib; diff --git a/modules/tabline/nvim-bufferline/nvim-bufferline.nix b/modules/tabline/nvim-bufferline/nvim-bufferline.nix index ec2478e..1ca3ff0 100644 --- a/modules/tabline/nvim-bufferline/nvim-bufferline.nix +++ b/modules/tabline/nvim-bufferline/nvim-bufferline.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption mkMappingOption; +in { options.vim.tabline.nvimBufferline = { enable = mkEnableOption "nvim-bufferline-lua as a bufferline"; diff --git a/modules/terminal/toggleterm/config.nix b/modules/terminal/toggleterm/config.nix index 9caf691..b115d32 100644 --- a/modules/terminal/toggleterm/config.nix +++ b/modules/terminal/toggleterm/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkMerge mkIf mkBinding nvim getExe; + cfg = config.vim.terminal.toggleterm; in { config = mkMerge [ @@ -59,7 +59,7 @@ in { end }) - vim.keymap.set('n', ${toJSON cfg.lazygit.mappings.open}, function() lazygit:toggle() end, {silent = true, noremap = true, desc = 'Open lazygit [toggleterm]'}) + vim.keymap.set('n', ${builtins.toJSON cfg.lazygit.mappings.open}, function() lazygit:toggle() end, {silent = true, noremap = true, desc = 'Open lazygit [toggleterm]'}) ''; } ) diff --git a/modules/terminal/toggleterm/toggleterm.nix b/modules/terminal/toggleterm/toggleterm.nix index 9acadd4..3579063 100644 --- a/modules/terminal/toggleterm/toggleterm.nix +++ b/modules/terminal/toggleterm/toggleterm.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption mkOption types mkMappingOption; +in { options.vim.terminal.toggleterm = { enable = mkEnableOption "toggleterm as a replacement to built-in terminal command"; mappings = { diff --git a/modules/theme/config.nix b/modules/theme/config.nix index 450821a..01be14c 100644 --- a/modules/theme/config.nix +++ b/modules/theme/config.nix @@ -2,8 +2,9 @@ config, lib, ... -}: -with lib; { +}: let + inherit (lib) mkDefault; +in { config = { vim.theme = { enable = mkDefault false; diff --git a/modules/theme/theme.nix b/modules/theme/theme.nix index 6dcb66d..094a56c 100644 --- a/modules/theme/theme.nix +++ b/modules/theme/theme.nix @@ -2,10 +2,9 @@ config, lib, ... -}: -with lib; -with lib.attrsets; -with builtins; let +}: let + inherit (lib) mkOption types attrNames mkIf nvim; + cfg = config.vim.theme; supported_themes = import ./supported_themes.nix {inherit lib;}; in { diff --git a/modules/treesitter/config.nix b/modules/treesitter/config.nix index 0bb3a0b..d197129 100644 --- a/modules/treesitter/config.nix +++ b/modules/treesitter/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) addDescriptionsToMappings mkIf optional mkSetBinding mkMerge nvim; + cfg = config.vim.treesitter; usingNvimCmp = config.vim.autocomplete.enable && config.vim.autocomplete.type == "nvim-cmp"; diff --git a/modules/treesitter/context.nix b/modules/treesitter/context.nix index bcc7ce9..d6859d4 100644 --- a/modules/treesitter/context.nix +++ b/modules/treesitter/context.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkEnableOption mkOption types mkIf nvim boolToString; + treesitter = config.vim.treesitter; cfg = treesitter.context; in { diff --git a/modules/treesitter/treesitter.nix b/modules/treesitter/treesitter.nix index e4e9f64..413f303 100644 --- a/modules/treesitter/treesitter.nix +++ b/modules/treesitter/treesitter.nix @@ -1,5 +1,6 @@ -{lib, ...}: -with lib; { +{lib, ...}: let + inherit (lib) mkEnableOption mkMappingOption mkOption types; +in { options.vim.treesitter = { enable = mkEnableOption "treesitter, also enabled automatically through language options"; diff --git a/modules/ui/colorizer/colorizer.nix b/modules/ui/colorizer/colorizer.nix index 54c932a..80faa40 100644 --- a/modules/ui/colorizer/colorizer.nix +++ b/modules/ui/colorizer/colorizer.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption mkOption types; +in { options.vim.ui.colorizer = { enable = mkEnableOption "nvim-colorizer.lua for color highlighting"; diff --git a/modules/ui/colorizer/config.nix b/modules/ui/colorizer/config.nix index 2b2d743..0ee5ef9 100644 --- a/modules/ui/colorizer/config.nix +++ b/modules/ui/colorizer/config.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim boolToString; + cfg = config.vim.ui.colorizer; in { config = mkIf cfg.enable { diff --git a/modules/ui/illuminate/config.nix b/modules/ui/illuminate/config.nix index dcf9ba3..4377622 100644 --- a/modules/ui/illuminate/config.nix +++ b/modules/ui/illuminate/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim; + cfg = config.vim.ui.illuminate; in { config = mkIf cfg.enable { diff --git a/modules/ui/illuminate/illuminate.nix b/modules/ui/illuminate/illuminate.nix index 952e28c..29426f9 100644 --- a/modules/ui/illuminate/illuminate.nix +++ b/modules/ui/illuminate/illuminate.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption; +in { options.vim.ui.illuminate = { enable = mkEnableOption "vim-illuminate: automatically highlight other uses of the word under the cursor"; }; diff --git a/modules/ui/modes/config.nix b/modules/ui/modes/config.nix index 827eca5..d8483af 100644 --- a/modules/ui/modes/config.nix +++ b/modules/ui/modes/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim boolToString; + cfg = config.vim.ui.modes-nvim; in { config = mkIf cfg.enable { diff --git a/modules/ui/modes/modes.nix b/modules/ui/modes/modes.nix index be4ed50..bfa80b0 100644 --- a/modules/ui/modes/modes.nix +++ b/modules/ui/modes/modes.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption mkOption types; +in { options.vim.ui.modes-nvim = { enable = mkEnableOption "modes.nvim's prismatic line decorations"; diff --git a/modules/ui/noice/config.nix b/modules/ui/noice/config.nix index c60fb38..2355497 100644 --- a/modules/ui/noice/config.nix +++ b/modules/ui/noice/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim boolToString; + cfg = config.vim.ui.noice; in { config = mkIf cfg.enable { diff --git a/modules/ui/noice/noice.nix b/modules/ui/noice/noice.nix index 0b3bd71..7afe82c 100644 --- a/modules/ui/noice/noice.nix +++ b/modules/ui/noice/noice.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption; +in { options.vim.ui.noice = { enable = mkEnableOption "noice-nvim UI modification library"; }; diff --git a/modules/ui/notifications/nvim-notify/config.nix b/modules/ui/notifications/nvim-notify/config.nix index 8eb50d8..d291366 100644 --- a/modules/ui/notifications/nvim-notify/config.nix +++ b/modules/ui/notifications/nvim-notify/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim; + cfg = config.vim.notify.nvim-notify; in { config = mkIf cfg.enable { diff --git a/modules/ui/notifications/nvim-notify/nvim-notify.nix b/modules/ui/notifications/nvim-notify/nvim-notify.nix index 0028a89..0374114 100644 --- a/modules/ui/notifications/nvim-notify/nvim-notify.nix +++ b/modules/ui/notifications/nvim-notify/nvim-notify.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption mkOption types; +in { options.vim.notify.nvim-notify = { enable = mkEnableOption "nvim-notify notifications"; stages = mkOption { diff --git a/modules/ui/smartcolumn/config.nix b/modules/ui/smartcolumn/config.nix index 6b611ad..5cf7b74 100644 --- a/modules/ui/smartcolumn/config.nix +++ b/modules/ui/smartcolumn/config.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim concatStringsSep; + cfg = config.vim.ui.smartcolumn; in { config = mkIf cfg.enable { diff --git a/modules/ui/smartcolumn/smartcolumn.nix b/modules/ui/smartcolumn/smartcolumn.nix index 0f01cfc..5d25c6e 100644 --- a/modules/ui/smartcolumn/smartcolumn.nix +++ b/modules/ui/smartcolumn/smartcolumn.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption mkOption types; +in { options.vim.ui.smartcolumn = { enable = mkEnableOption "line length indicator"; diff --git a/modules/utility/binds/cheatsheet/cheatsheet.nix b/modules/utility/binds/cheatsheet/cheatsheet.nix index 517f4e2..667fafa 100644 --- a/modules/utility/binds/cheatsheet/cheatsheet.nix +++ b/modules/utility/binds/cheatsheet/cheatsheet.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption; +in { options.vim.binds.cheatsheet = { enable = mkEnableOption "cheatsheet-nvim: searchable cheatsheet for nvim using telescope"; }; diff --git a/modules/utility/binds/cheatsheet/config.nix b/modules/utility/binds/cheatsheet/config.nix index e6d4ea5..b5439a9 100644 --- a/modules/utility/binds/cheatsheet/config.nix +++ b/modules/utility/binds/cheatsheet/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim; + cfg = config.vim.binds.cheatsheet; in { config = mkIf (cfg.enable) { diff --git a/modules/utility/binds/which-key/config.nix b/modules/utility/binds/which-key/config.nix index 506d888..9aa123d 100644 --- a/modules/utility/binds/which-key/config.nix +++ b/modules/utility/binds/which-key/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim; + cfg = config.vim.binds.whichKey; in { config = mkIf (cfg.enable) { diff --git a/modules/utility/binds/which-key/which-key.nix b/modules/utility/binds/which-key/which-key.nix index b8e6fa0..ceba7de 100644 --- a/modules/utility/binds/which-key/which-key.nix +++ b/modules/utility/binds/which-key/which-key.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption; +in { options.vim.binds.whichKey = { enable = mkEnableOption "which-key keybind helper menu"; }; diff --git a/modules/utility/ccc/ccc.nix b/modules/utility/ccc/ccc.nix index c0faa55..dab4ec9 100644 --- a/modules/utility/ccc/ccc.nix +++ b/modules/utility/ccc/ccc.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption mkMappingOption; +in { options.vim.utility.ccc = { enable = mkEnableOption "ccc color picker for neovim"; diff --git a/modules/utility/ccc/config.nix b/modules/utility/ccc/config.nix index 1b04618..5318d02 100644 --- a/modules/utility/ccc/config.nix +++ b/modules/utility/ccc/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) addDescriptionsToMappings mkIf nvim; + cfg = config.vim.utility.ccc; self = import ./ccc.nix {inherit lib;}; diff --git a/modules/utility/diffview/config.nix b/modules/utility/diffview/config.nix index 8ce66a0..a572805 100644 --- a/modules/utility/diffview/config.nix +++ b/modules/utility/diffview/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim; + cfg = config.vim.utility.diffview-nvim; in { config = mkIf (cfg.enable) { diff --git a/modules/utility/diffview/diffview.nix b/modules/utility/diffview/diffview.nix index dd6fae3..4830aba 100644 --- a/modules/utility/diffview/diffview.nix +++ b/modules/utility/diffview/diffview.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption; +in { options.vim.utility.diffview-nvim = { enable = mkEnableOption "diffview-nvim: cycle through diffs for all modified files for any git rev"; }; diff --git a/modules/utility/gestures/gesture-nvim/config.nix b/modules/utility/gestures/gesture-nvim/config.nix index 046c062..a926051 100644 --- a/modules/utility/gestures/gesture-nvim/config.nix +++ b/modules/utility/gestures/gesture-nvim/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetLuaBinding nvim; + cfg = config.vim.gestures.gesture-nvim; self = import ./gesture-nvim.nix {inherit lib;}; diff --git a/modules/utility/gestures/gesture-nvim/gesture-nvim.nix b/modules/utility/gestures/gesture-nvim/gesture-nvim.nix index 06071b8..bd963b3 100644 --- a/modules/utility/gestures/gesture-nvim/gesture-nvim.nix +++ b/modules/utility/gestures/gesture-nvim/gesture-nvim.nix @@ -1,5 +1,6 @@ -{lib, ...}: -with lib; { +{lib, ...}: let + inherit (lib) mkEnableOption mkMappingOption; +in { options.vim.gestures.gesture-nvim = { enable = mkEnableOption "gesture-nvim: mouse gestures"; diff --git a/modules/utility/icon-picker/config.nix b/modules/utility/icon-picker/config.nix index 75c1490..642c9a4 100644 --- a/modules/utility/icon-picker/config.nix +++ b/modules/utility/icon-picker/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim; + cfg = config.vim.utility.icon-picker; in { config = mkIf (cfg.enable) { diff --git a/modules/utility/icon-picker/icon-picker.nix b/modules/utility/icon-picker/icon-picker.nix index 29aee8e..94e16be 100644 --- a/modules/utility/icon-picker/icon-picker.nix +++ b/modules/utility/icon-picker/icon-picker.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption; +in { options.vim.utility.icon-picker = { enable = mkEnableOption "nerdfonts icon picker for nvim"; }; diff --git a/modules/utility/motion/hop/config.nix b/modules/utility/motion/hop/config.nix index a5aa92c..34015dc 100644 --- a/modules/utility/motion/hop/config.nix +++ b/modules/utility/motion/hop/config.nix @@ -2,8 +2,9 @@ config, lib, ... -}: -with lib; let +}: let + inherit (lib) addDescriptionsToMappings mkIf mkSetBinding nvim; + cfg = config.vim.utility.motion.hop; self = import ./hop.nix {inherit lib;}; diff --git a/modules/utility/motion/hop/hop.nix b/modules/utility/motion/hop/hop.nix index 1eef3f8..ada8bc3 100644 --- a/modules/utility/motion/hop/hop.nix +++ b/modules/utility/motion/hop/hop.nix @@ -1,5 +1,6 @@ -{lib, ...}: -with lib; { +{lib, ...}: let + inherit (lib) mkMappingOption mkEnableOption; +in { options.vim.utility.motion.hop = { mappings = { hop = mkMappingOption "Jump to occurences [hop.nvim]" "h"; diff --git a/modules/utility/motion/leap/config.nix b/modules/utility/motion/leap/config.nix index 4a6c571..4bfa3e8 100644 --- a/modules/utility/motion/leap/config.nix +++ b/modules/utility/motion/leap/config.nix @@ -2,8 +2,9 @@ config, lib, ... -}: -with lib; let +}: let + inherit (lib) mkIf mkMerge mkBinding nvim; + cfg = config.vim.utility.motion.leap; in { config = mkIf cfg.enable { diff --git a/modules/utility/motion/leap/leap.nix b/modules/utility/motion/leap/leap.nix index 3ff9302..6f00822 100644 --- a/modules/utility/motion/leap/leap.nix +++ b/modules/utility/motion/leap/leap.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption mkOption types; +in { options.vim.utility.motion.leap = { enable = mkEnableOption "leap.nvim plugin (easy motion)"; diff --git a/modules/utility/surround/config.nix b/modules/utility/surround/config.nix index aa7f7bd..78ec0a8 100644 --- a/modules/utility/surround/config.nix +++ b/modules/utility/surround/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim; + cfg = config.vim.utility.surround; self = import ./surround.nix {inherit lib config;}; mappingDefinitions = self.options.vim.utility.surround.mappings; diff --git a/modules/utility/surround/surround.nix b/modules/utility/surround/surround.nix index 405e3f2..7b20fb4 100644 --- a/modules/utility/surround/surround.nix +++ b/modules/utility/surround/surround.nix @@ -2,9 +2,9 @@ lib, config, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkOption types mkIf mkDefault; +in { options.vim.utility.surround = { enable = mkOption { type = types.bool; diff --git a/modules/utility/telescope/config.nix b/modules/utility/telescope/config.nix index 0156a0d..53cde96 100644 --- a/modules/utility/telescope/config.nix +++ b/modules/utility/telescope/config.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim; + cfg = config.vim.telescope; self = import ./telescope.nix {inherit lib;}; mappingDefinitions = self.options.vim.telescope.mappings; diff --git a/modules/utility/telescope/telescope.nix b/modules/utility/telescope/telescope.nix index 39d399b..12ea887 100644 --- a/modules/utility/telescope/telescope.nix +++ b/modules/utility/telescope/telescope.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkMappingOption mkEnableOption; +in { options.vim.telescope = { mappings = { findProjects = mkMappingOption "Find files [Telescope]" "fp"; diff --git a/modules/utility/wakatime/config.nix b/modules/utility/wakatime/config.nix index fb99074..69063e2 100644 --- a/modules/utility/wakatime/config.nix +++ b/modules/utility/wakatime/config.nix @@ -3,9 +3,9 @@ lib, pkgs, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim; + cfg = config.vim.utility.vim-wakatime; in { config = mkIf (cfg.enable) { diff --git a/modules/utility/wakatime/vim-wakatime.nix b/modules/utility/wakatime/vim-wakatime.nix index 496e929..f0f42b9 100644 --- a/modules/utility/wakatime/vim-wakatime.nix +++ b/modules/utility/wakatime/vim-wakatime.nix @@ -2,9 +2,9 @@ lib, pkgs, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption mkOption types; +in { options.vim.utility.vim-wakatime = { enable = mkEnableOption "vim-wakatime: live code statistics"; diff --git a/modules/visuals/config.nix b/modules/visuals/config.nix index ab580ca..5cdd4f4 100644 --- a/modules/visuals/config.nix +++ b/modules/visuals/config.nix @@ -2,8 +2,9 @@ config, lib, ... -}: -with lib; let +}: let + inherit (lib) mkIf mkMerge nvim optionalString boolToString mkBinding; + cfg = config.vim.visuals; in { config = mkIf cfg.enable (mkMerge [ diff --git a/modules/visuals/visuals.nix b/modules/visuals/visuals.nix index f77e470..97ace23 100644 --- a/modules/visuals/visuals.nix +++ b/modules/visuals/visuals.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkEnableOption mkMappingOption mkOption types literalExpression; + cfg = config.vim.visuals; in { options.vim.visuals = {