Skip to content

Commit

Permalink
treewide: move from 'with lib' to 'inherit (lib) ...'
Browse files Browse the repository at this point in the history
  • Loading branch information
FrothyMarrow committed Nov 7, 2023
1 parent 3fde6a4 commit ffa25c8
Show file tree
Hide file tree
Showing 90 changed files with 281 additions and 273 deletions.
6 changes: 3 additions & 3 deletions modules/assistant/copilot/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''
Expand Down
6 changes: 3 additions & 3 deletions modules/assistant/copilot/copilot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
6 changes: 3 additions & 3 deletions modules/assistant/tabnine/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions modules/assistant/tabnine/tabnine.nix
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
6 changes: 3 additions & 3 deletions modules/autopairs/nvim-autopairs/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
lib,
config,
...
}:
with lib;
with builtins; let
}: let
inherit (lib) mkIf nvim optionalString boolToString;

cfg = config.vim.autopairs;
in {
config =
Expand Down
6 changes: 3 additions & 3 deletions modules/autopairs/nvim-autopairs/nvim-autopairs.nix
Original file line number Diff line number Diff line change
@@ -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;};
Expand Down
6 changes: 3 additions & 3 deletions modules/comments/comment-nvim/comment-nvim.nix
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
6 changes: 3 additions & 3 deletions modules/comments/comment-nvim/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions modules/completion/nvim-cmp/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions modules/completion/nvim-cmp/nvim-cmp.nix
Original file line number Diff line number Diff line change
@@ -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;};
Expand Down
1 change: 1 addition & 0 deletions modules/core/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions modules/dashboard/alpha/alpha.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};
Expand Down
6 changes: 3 additions & 3 deletions modules/dashboard/alpha/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions modules/dashboard/dashboard-nvim/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions modules/dashboard/dashboard-nvim/dashboard-nvim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};
Expand Down
6 changes: 3 additions & 3 deletions modules/dashboard/startify/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
config,
lib,
...
}:
with builtins;
with lib; let
}: let
inherit (lib) mkIf;

cfg = config.vim.dashboard.startify;

mkVimBool = val:
Expand Down
6 changes: 3 additions & 3 deletions modules/dashboard/startify/startify.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
6 changes: 3 additions & 3 deletions modules/debugger/nvim-dap/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions modules/debugger/nvim-dap/nvim-dap.nix
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
6 changes: 3 additions & 3 deletions modules/filetree/nvimtree/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions modules/filetree/nvimtree/nvimtree.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
9 changes: 4 additions & 5 deletions modules/git/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;};
Expand All @@ -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)
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions modules/git/git.nix
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
5 changes: 3 additions & 2 deletions modules/minimap/codewindow/codewindow.nix
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
6 changes: 3 additions & 3 deletions modules/minimap/codewindow/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;};
Expand Down
6 changes: 3 additions & 3 deletions modules/minimap/minimap-vim/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions modules/minimap/minimap-vim/minimap-vim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};
Expand Down
6 changes: 3 additions & 3 deletions modules/notes/mind-nvim/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions modules/notes/mind-nvim/mind-nvim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
};
Expand Down
6 changes: 3 additions & 3 deletions modules/notes/obsidian/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions modules/notes/obsidian/obsidian.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Loading

0 comments on commit ffa25c8

Please sign in to comment.