From 7518c31ca88c2a84d868c0f624d5e8263ec05c1b Mon Sep 17 00:00:00 2001 From: Frothy <76622149+FrothyMarrow@users.noreply.github.com> Date: Tue, 7 Nov 2023 19:16:46 -0700 Subject: [PATCH] treewide: move missing modules from 'with lib' to 'inherit (lib) ...' --- modules/languages/bash/bash.nix | 9 ++++----- modules/languages/bash/config.nix | 6 +++--- modules/languages/clang.nix | 10 +++++----- modules/languages/dart/config.nix | 6 +++--- modules/languages/dart/dart.nix | 8 ++++---- modules/languages/elixir/config.nix | 8 ++++---- modules/languages/elixir/elixir-tools.nix | 6 +++--- modules/languages/go.nix | 10 +++++----- modules/languages/html.nix | 6 +++--- modules/languages/java.nix | 6 +++--- modules/languages/lua.nix | 6 +++--- modules/languages/markdown/config.nix | 6 +++--- modules/languages/markdown/markdown.nix | 6 +++--- modules/languages/nix.nix | 8 ++++---- modules/languages/php.nix | 8 ++++---- modules/languages/python.nix | 12 ++++++------ modules/languages/rust.nix | 6 +++--- modules/languages/sql.nix | 10 +++++----- modules/languages/svelte.nix | 10 +++++----- modules/languages/tidal/config.nix | 6 +++--- modules/languages/tidal/tidal.nix | 6 +++--- modules/languages/ts.nix | 10 +++++----- modules/languages/zig.nix | 6 +++--- modules/lsp/config.nix | 6 +++--- modules/lsp/lightbulb/config.nix | 6 +++--- modules/lsp/lightbulb/lightbulb.nix | 6 +++--- modules/lsp/lsp-signature/config.nix | 6 +++--- modules/lsp/lsp-signature/lsp-signature.nix | 6 +++--- modules/lsp/lspconfig/config.nix | 6 +++--- modules/lsp/lspconfig/lspconfig.nix | 6 +++--- modules/lsp/lspkind/config.nix | 6 +++--- modules/lsp/lspkind/lspkind.nix | 6 +++--- modules/lsp/lsplines/config.nix | 6 +++--- modules/lsp/lsplines/lsplines.nix | 6 +++--- modules/lsp/lspsaga/config.nix | 6 +++--- modules/lsp/lspsaga/lspsaga.nix | 6 +++--- modules/lsp/module.nix | 5 ++--- modules/lsp/null-ls/config.nix | 6 +++--- modules/lsp/null-ls/null-ls.nix | 6 +++--- modules/lsp/nvim-code-action-menu/config.nix | 6 +++--- .../nvim-code-action-menu/nvim-code-action-menu.nix | 5 +++-- modules/lsp/trouble/config.nix | 6 +++--- modules/lsp/trouble/trouble.nix | 5 +++-- 43 files changed, 146 insertions(+), 146 deletions(-) diff --git a/modules/languages/bash/bash.nix b/modules/languages/bash/bash.nix index 150ad0d..2f3cf9b 100644 --- a/modules/languages/bash/bash.nix +++ b/modules/languages/bash/bash.nix @@ -3,9 +3,8 @@ config, lib, ... -}: -with builtins; let - inherit (lib) mkOption mkEnableOption types; +}: let + inherit (lib) mkOption mkEnableOption types isList nvim; cfg = config.vim.languages.bash; @@ -70,7 +69,7 @@ in { server = mkOption { description = "Bash LSP server to use"; - type = with types; enum (attrNames servers); + type = with types; enum (builtins.attrNames servers); default = defaultServer; }; @@ -90,7 +89,7 @@ in { }; type = mkOption { description = "Bash formatter to use"; - type = with types; enum (attrNames formats); + type = with types; enum (builtins.attrNames formats); default = defaultFormat; }; diff --git a/modules/languages/bash/config.nix b/modules/languages/bash/config.nix index efd0ea9..241032d 100644 --- a/modules/languages/bash/config.nix +++ b/modules/languages/bash/config.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) isList nvim mkIf mkMerge; + cfg = config.vim.languages.bash; diagnostics = { shellcheck = { diff --git a/modules/languages/clang.nix b/modules/languages/clang.nix index 3ed16d7..5e93dd0 100644 --- a/modules/languages/clang.nix +++ b/modules/languages/clang.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) isList nvim optionalString mkEnableOption mkOption types mkIf mkMerge; + cfg = config.vim.languages.clang; defaultServer = "ccls"; @@ -93,7 +93,7 @@ in { server = mkOption { description = "The clang LSP server to use"; - type = with types; enum (attrNames servers); + type = with types; enum (builtins.attrNames servers); default = defaultServer; }; @@ -119,7 +119,7 @@ in { }; debugger = mkOption { description = "clang debugger to use"; - type = with types; enum (attrNames debuggers); + type = with types; enum (builtins.attrNames debuggers); default = defaultDebugger; }; package = mkOption { diff --git a/modules/languages/dart/config.nix b/modules/languages/dart/config.nix index 991a384..510a413 100644 --- a/modules/languages/dart/config.nix +++ b/modules/languages/dart/config.nix @@ -3,9 +3,9 @@ lib, pkgs, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) isList nvim mkIf mkMerge optionalString boolToString; + cfg = config.vim.languages.dart; ftcfg = cfg.flutter-tools; servers = { diff --git a/modules/languages/dart/dart.nix b/modules/languages/dart/dart.nix index edccb12..f76be78 100644 --- a/modules/languages/dart/dart.nix +++ b/modules/languages/dart/dart.nix @@ -3,9 +3,9 @@ lib, pkgs, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) isList nvim mkEnableOption mkOption types optionalString; + cfg = config.vim.languages.dart; defaultServer = "dart"; servers = { @@ -38,7 +38,7 @@ in { enable = mkEnableOption "Dart LSP support"; server = mkOption { description = "The Dart LSP server to use"; - type = with types; enum (attrNames servers); + type = with types; enum (builtins.attrNames servers); default = defaultServer; }; package = mkOption { diff --git a/modules/languages/elixir/config.nix b/modules/languages/elixir/config.nix index e0ef5f9..dc05a48 100644 --- a/modules/languages/elixir/config.nix +++ b/modules/languages/elixir/config.nix @@ -3,9 +3,9 @@ lib, pkgs, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) nvim mkIf getExe; + cfg = config.vim.languages.elixir; in { config = mkIf (cfg.enable) { @@ -23,7 +23,7 @@ in { -- alternatively, point to an existing elixir-ls installation (optional) -- not currently supported by elixirls, but can be a table if you wish to pass other args `{"path/to/elixirls", "--foo"}` - cmd = "${lib.getExe pkgs.elixir-ls}", + cmd = "${getExe pkgs.elixir-ls}", -- default settings, use the `settings` function to override settings settings = elixirls.settings { diff --git a/modules/languages/elixir/elixir-tools.nix b/modules/languages/elixir/elixir-tools.nix index 5232acb..42e69a3 100644 --- a/modules/languages/elixir/elixir-tools.nix +++ b/modules/languages/elixir/elixir-tools.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption; +in { options.vim.languages.elixir = { enable = mkEnableOption "Elixir language support"; }; diff --git a/modules/languages/go.nix b/modules/languages/go.nix index 27717f4..3045669 100644 --- a/modules/languages/go.nix +++ b/modules/languages/go.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) isList nvim getExe mkEnableOption mkOption types mkMerge mkIf; + cfg = config.vim.languages.go; defaultServer = "gopls"; @@ -80,7 +80,7 @@ in { server = mkOption { description = "Go LSP server to use"; - type = with types; enum (attrNames servers); + type = with types; enum (builtins.attrNames servers); default = defaultServer; }; @@ -100,7 +100,7 @@ in { }; debugger = mkOption { description = "Go debugger to use"; - type = with types; enum (attrNames debuggers); + type = with types; enum (builtins.attrNames debuggers); default = defaultDebugger; }; package = mkOption { diff --git a/modules/languages/html.nix b/modules/languages/html.nix index b897e1c..e2eadac 100644 --- a/modules/languages/html.nix +++ b/modules/languages/html.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkEnableOption mkOption types nvim mkIf mkMerge optional; + cfg = config.vim.languages.html; in { options.vim.languages.html = { diff --git a/modules/languages/java.nix b/modules/languages/java.nix index 65daa8e..d09458f 100644 --- a/modules/languages/java.nix +++ b/modules/languages/java.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge; + cfg = config.vim.languages.java; in { options.vim.languages.java = { diff --git a/modules/languages/lua.nix b/modules/languages/lua.nix index d42d13a..e902aa9 100644 --- a/modules/languages/lua.nix +++ b/modules/languages/lua.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString getExe; + cfg = config.vim.languages.lua; in { options.vim.languages.lua = { diff --git a/modules/languages/markdown/config.nix b/modules/languages/markdown/config.nix index b031f47..ba49fb9 100644 --- a/modules/languages/markdown/config.nix +++ b/modules/languages/markdown/config.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) nvim mkIf mkMerge; + cfg = config.vim.languages.markdown; in { config = mkIf cfg.enable (mkMerge [ diff --git a/modules/languages/markdown/markdown.nix b/modules/languages/markdown/markdown.nix index 551a655..153eae5 100644 --- a/modules/languages/markdown/markdown.nix +++ b/modules/languages/markdown/markdown.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkEnableOption mkOption types nvim; + cfg = config.vim.languages.markdown; in { options.vim.languages.markdown = { diff --git a/modules/languages/nix.nix b/modules/languages/nix.nix index 8b90b28..03b262d 100644 --- a/modules/languages/nix.nix +++ b/modules/languages/nix.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString; + cfg = config.vim.languages.nix; useFormat = "on_attach = default_on_attach"; @@ -146,7 +146,7 @@ in { type = mkOption { description = "Nix formatter to use"; - type = with types; enum (attrNames formats); + type = with types; enum (builtins.attrNames formats); default = defaultFormat; }; package = mkOption { diff --git a/modules/languages/php.nix b/modules/languages/php.nix index 63bc409..8e4b03f 100644 --- a/modules/languages/php.nix +++ b/modules/languages/php.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge getExe; + cfg = config.vim.languages.php; defaultServer = "phpactor"; @@ -72,7 +72,7 @@ in { server = mkOption { description = "PHP LSP server to use"; - type = with types; enum (attrNames servers); + type = with types; enum (builtins.attrNames servers); default = defaultServer; }; diff --git a/modules/languages/python.nix b/modules/languages/python.nix index d228ff6..ac3a53e 100644 --- a/modules/languages/python.nix +++ b/modules/languages/python.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge getExe literalExpression; + cfg = config.vim.languages.python; defaultServer = "pyright"; @@ -149,7 +149,7 @@ in { server = mkOption { description = "Python LSP server to use"; - type = with types; enum (attrNames servers); + type = with types; enum (builtins.attrNames servers); default = defaultServer; }; @@ -166,7 +166,7 @@ in { type = mkOption { description = "Python formatter to use"; - type = with types; enum (attrNames formats); + type = with types; enum (builtins.attrNames formats); default = defaultFormat; }; @@ -186,7 +186,7 @@ in { }; debugger = mkOption { description = "Python debugger to use"; - type = with types; enum (attrNames debuggers); + type = with types; enum (builtins.attrNames debuggers); default = defaultDebugger; }; package = mkOption { diff --git a/modules/languages/rust.nix b/modules/languages/rust.nix index 3ab4433..1112f7b 100644 --- a/modules/languages/rust.nix +++ b/modules/languages/rust.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString boolToString optionals; + cfg = config.vim.languages.rust; in { options.vim.languages.rust = { diff --git a/modules/languages/sql.nix b/modules/languages/sql.nix index 2104050..dc5f564 100644 --- a/modules/languages/sql.nix +++ b/modules/languages/sql.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge; + cfg = config.vim.languages.sql; sqlfluffDefault = pkgs.sqlfluff; @@ -86,7 +86,7 @@ in { server = mkOption { description = "SQL LSP server to use"; - type = with types; enum (attrNames servers); + type = with types; enum (builtins.attrNames servers); default = defaultServer; }; @@ -103,7 +103,7 @@ in { type = mkOption { description = "SQL formatter to use"; - type = with types; enum (attrNames formats); + type = with types; enum (builtins.attrNames formats); default = defaultFormat; }; diff --git a/modules/languages/svelte.nix b/modules/languages/svelte.nix index 20a2356..786b012 100644 --- a/modules/languages/svelte.nix +++ b/modules/languages/svelte.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge; + cfg = config.vim.languages.svelte; defaultServer = "svelte"; @@ -72,7 +72,7 @@ in { server = mkOption { description = "Svelte LSP server to use"; - type = with types; enum (attrNames servers); + type = with types; enum (builtins.attrNames servers); default = defaultServer; }; @@ -89,7 +89,7 @@ in { type = mkOption { description = "Svelte formatter to use"; - type = with types; enum (attrNames formats); + type = with types; enum (builtins.attrNames formats); default = defaultFormat; }; diff --git a/modules/languages/tidal/config.nix b/modules/languages/tidal/config.nix index 7c748e5..c659d06 100644 --- a/modules/languages/tidal/config.nix +++ b/modules/languages/tidal/config.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf; + cfg = config.vim.tidal; in { config = mkIf (cfg.enable) { diff --git a/modules/languages/tidal/tidal.nix b/modules/languages/tidal/tidal.nix index 5bcd255..e5ec413 100644 --- a/modules/languages/tidal/tidal.nix +++ b/modules/languages/tidal/tidal.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption mkOption types; +in { options.vim.tidal = { enable = mkEnableOption "tidalcycles tools and plugins"; diff --git a/modules/languages/ts.nix b/modules/languages/ts.nix index 58c1bc9..b11141d 100644 --- a/modules/languages/ts.nix +++ b/modules/languages/ts.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge; + cfg = config.vim.languages.ts; defaultServer = "tsserver"; @@ -98,7 +98,7 @@ in { server = mkOption { description = "Typescript/Javascript LSP server to use"; - type = with types; enum (attrNames servers); + type = with types; enum (builtins.attrNames servers); default = defaultServer; }; @@ -115,7 +115,7 @@ in { type = mkOption { description = "Typescript/Javascript formatter to use"; - type = with types; enum (attrNames formats); + type = with types; enum (builtins.attrNames formats); default = defaultFormat; }; diff --git a/modules/languages/zig.nix b/modules/languages/zig.nix index 7dbb6d6..bb4f278 100644 --- a/modules/languages/zig.nix +++ b/modules/languages/zig.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge; + cfg = config.vim.languages.zig; in { options.vim.languages.zig = { diff --git a/modules/lsp/config.nix b/modules/lsp/config.nix index eacbfa2..1d44ea7 100644 --- a/modules/lsp/config.nix +++ b/modules/lsp/config.nix @@ -3,9 +3,9 @@ lib, pkgs, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) addDescriptionsToMappings mkIf optional boolToString optionalString; + cfg = config.vim.lsp; usingNvimCmp = config.vim.autocomplete.enable && config.vim.autocomplete.type == "nvim-cmp"; self = import ./module.nix {inherit config lib pkgs;}; diff --git a/modules/lsp/lightbulb/config.nix b/modules/lsp/lightbulb/config.nix index 97f5e07..3a13f68 100644 --- a/modules/lsp/lightbulb/config.nix +++ b/modules/lsp/lightbulb/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim; + cfg = config.vim.lsp; in { config = mkIf (cfg.enable && cfg.lightbulb.enable) { diff --git a/modules/lsp/lightbulb/lightbulb.nix b/modules/lsp/lightbulb/lightbulb.nix index b754835..44d0ce0 100644 --- a/modules/lsp/lightbulb/lightbulb.nix +++ b/modules/lsp/lightbulb/lightbulb.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption; +in { options.vim.lsp = { lightbulb = { enable = mkEnableOption "Lightbulb for code actions. Requires an emoji font"; diff --git a/modules/lsp/lsp-signature/config.nix b/modules/lsp/lsp-signature/config.nix index 1e73476..18ac5d1 100644 --- a/modules/lsp/lsp-signature/config.nix +++ b/modules/lsp/lsp-signature/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim optionalString; + cfg = config.vim.lsp; in { config = mkIf (cfg.enable && cfg.lspSignature.enable) { diff --git a/modules/lsp/lsp-signature/lsp-signature.nix b/modules/lsp/lsp-signature/lsp-signature.nix index b8b0a72..d05161e 100644 --- a/modules/lsp/lsp-signature/lsp-signature.nix +++ b/modules/lsp/lsp-signature/lsp-signature.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption; +in { options.vim.lsp = { lspSignature = { enable = mkEnableOption "lsp signature viewer"; diff --git a/modules/lsp/lspconfig/config.nix b/modules/lsp/lspconfig/config.nix index e9d7b3c..527bbed 100644 --- a/modules/lsp/lspconfig/config.nix +++ b/modules/lsp/lspconfig/config.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf mkMerge nvim optionalString mapAttrs; + cfg = config.vim.lsp; in { config = mkIf cfg.lspconfig.enable (mkMerge [ diff --git a/modules/lsp/lspconfig/lspconfig.nix b/modules/lsp/lspconfig/lspconfig.nix index 7bc3dab..7dd8ff0 100644 --- a/modules/lsp/lspconfig/lspconfig.nix +++ b/modules/lsp/lspconfig/lspconfig.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; { +}: let + inherit (lib) mkEnableOption mkOption types; +in { options.vim.lsp.lspconfig = { enable = mkEnableOption "nvim-lspconfig, also enabled automatically"; diff --git a/modules/lsp/lspkind/config.nix b/modules/lsp/lspkind/config.nix index a243d62..2c21c26 100644 --- a/modules/lsp/lspkind/config.nix +++ b/modules/lsp/lspkind/config.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim; + cfg = config.vim.lsp; in { config = mkIf (cfg.enable && cfg.lspkind.enable) { diff --git a/modules/lsp/lspkind/lspkind.nix b/modules/lsp/lspkind/lspkind.nix index 82d721b..4856688 100644 --- a/modules/lsp/lspkind/lspkind.nix +++ b/modules/lsp/lspkind/lspkind.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkEnableOption mkOption types; + cfg = config.vim.lsp; in { options.vim.lsp = { diff --git a/modules/lsp/lsplines/config.nix b/modules/lsp/lsplines/config.nix index 8fe46d3..66eb5ff 100644 --- a/modules/lsp/lsplines/config.nix +++ b/modules/lsp/lsplines/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf nvim; + cfg = config.vim.lsp; in { config = mkIf (cfg.enable && cfg.lsplines.enable) { diff --git a/modules/lsp/lsplines/lsplines.nix b/modules/lsp/lsplines/lsplines.nix index 2b3eec4..9b5f6a6 100644 --- a/modules/lsp/lsplines/lsplines.nix +++ b/modules/lsp/lsplines/lsplines.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption; +in { options.vim.lsp = { lsplines = { enable = mkEnableOption "diagnostics using virtual lines on top of the real line of code. [lsp_lines]"; diff --git a/modules/lsp/lspsaga/config.nix b/modules/lsp/lspsaga/config.nix index 74b91fc..722bdde 100644 --- a/modules/lsp/lspsaga/config.nix +++ b/modules/lsp/lspsaga/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) addDescriptionsToMappings mkIf mkSetLuaBinding mkMerge nvim optionalString; + cfg = config.vim.lsp; self = import ./lspsaga.nix {inherit lib;}; diff --git a/modules/lsp/lspsaga/lspsaga.nix b/modules/lsp/lspsaga/lspsaga.nix index b3459f3..35e1ecc 100644 --- a/modules/lsp/lspsaga/lspsaga.nix +++ b/modules/lsp/lspsaga/lspsaga.nix @@ -1,6 +1,6 @@ -{lib, ...}: -with lib; -with builtins; { +{lib, ...}: let + inherit (lib) mkEnableOption mkMappingOption; +in { options.vim.lsp.lspsaga = { enable = mkEnableOption "LSP Saga"; diff --git a/modules/lsp/module.nix b/modules/lsp/module.nix index 38d73b1..1a56240 100644 --- a/modules/lsp/module.nix +++ b/modules/lsp/module.nix @@ -1,6 +1,5 @@ -{lib, ...}: -with lib; -with builtins; let +{lib, ...}: let + inherit (lib) mkEnableOption mkMappingOption; in { options.vim.lsp = { enable = mkEnableOption "LSP, also enabled automatically through null-ls and lspconfig options"; diff --git a/modules/lsp/null-ls/config.nix b/modules/lsp/null-ls/config.nix index bc5aee7..23a6818 100644 --- a/modules/lsp/null-ls/config.nix +++ b/modules/lsp/null-ls/config.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkIf mkMerge nvim mapAttrs; + cfg = config.vim.lsp; in { config = mkIf cfg.null-ls.enable (mkMerge [ diff --git a/modules/lsp/null-ls/null-ls.nix b/modules/lsp/null-ls/null-ls.nix index b8b661c..3ffb0ca 100644 --- a/modules/lsp/null-ls/null-ls.nix +++ b/modules/lsp/null-ls/null-ls.nix @@ -3,9 +3,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) mkEnableOption mkOption types; + cfg = config.vim.lsp; in { options.vim.lsp.null-ls = { diff --git a/modules/lsp/nvim-code-action-menu/config.nix b/modules/lsp/nvim-code-action-menu/config.nix index 8fd54e5..c64f027 100644 --- a/modules/lsp/nvim-code-action-menu/config.nix +++ b/modules/lsp/nvim-code-action-menu/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) addDescriptionsToMappings mkIf mkSetBinding nvim; + cfg = config.vim.lsp; self = import ./nvim-code-action-menu.nix {inherit lib;}; diff --git a/modules/lsp/nvim-code-action-menu/nvim-code-action-menu.nix b/modules/lsp/nvim-code-action-menu/nvim-code-action-menu.nix index deb5166..c04beda 100644 --- a/modules/lsp/nvim-code-action-menu/nvim-code-action-menu.nix +++ b/modules/lsp/nvim-code-action-menu/nvim-code-action-menu.nix @@ -1,5 +1,6 @@ -{lib, ...}: -with lib; { +{lib, ...}: let + inherit (lib) mkEnableOption mkMappingOption; +in { options.vim.lsp = { nvimCodeActionMenu = { enable = mkEnableOption "nvim code action menu"; diff --git a/modules/lsp/trouble/config.nix b/modules/lsp/trouble/config.nix index 0f3aa11..ee136a5 100644 --- a/modules/lsp/trouble/config.nix +++ b/modules/lsp/trouble/config.nix @@ -2,9 +2,9 @@ config, lib, ... -}: -with lib; -with builtins; let +}: let + inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim; + cfg = config.vim.lsp; self = import ./trouble.nix {inherit lib;}; diff --git a/modules/lsp/trouble/trouble.nix b/modules/lsp/trouble/trouble.nix index 4423fdf..b8aa0de 100644 --- a/modules/lsp/trouble/trouble.nix +++ b/modules/lsp/trouble/trouble.nix @@ -1,5 +1,6 @@ -{lib, ...}: -with lib; { +{lib, ...}: let + inherit (lib) mkEnableOption mkMappingOption; +in { options.vim.lsp = { trouble = { enable = mkEnableOption "trouble diagnostics viewer";