treewide: move missing modules from 'with lib' to 'inherit (lib) ...'

This commit is contained in:
Frothy 2023-11-07 19:16:46 -07:00
parent 4700a988b3
commit 7518c31ca8
43 changed files with 146 additions and 146 deletions

View File

@ -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;
};

View File

@ -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 = {

View File

@ -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 {

View File

@ -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 = {

View File

@ -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 {

View File

@ -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 {

View File

@ -2,9 +2,9 @@
config,
lib,
...
}:
with lib;
with builtins; {
}: let
inherit (lib) mkEnableOption;
in {
options.vim.languages.elixir = {
enable = mkEnableOption "Elixir language support";
};

View File

@ -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 {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 [

View File

@ -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 = {

View File

@ -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 {

View File

@ -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;
};

View File

@ -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 {

View File

@ -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 = {

View File

@ -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;
};

View File

@ -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;
};

View File

@ -3,9 +3,9 @@
config,
lib,
...
}:
with lib;
with builtins; let
}: let
inherit (lib) mkIf;
cfg = config.vim.tidal;
in {
config = mkIf (cfg.enable) {

View File

@ -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";

View File

@ -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;
};

View File

@ -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 = {

View File

@ -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;};

View File

@ -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) {

View File

@ -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";

View File

@ -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) {

View File

@ -2,9 +2,9 @@
config,
lib,
...
}:
with lib;
with builtins; {
}: let
inherit (lib) mkEnableOption;
in {
options.vim.lsp = {
lspSignature = {
enable = mkEnableOption "lsp signature viewer";

View File

@ -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 [

View File

@ -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";

View File

@ -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) {

View File

@ -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 = {

View File

@ -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) {

View File

@ -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]";

View File

@ -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;};

View File

@ -1,6 +1,6 @@
{lib, ...}:
with lib;
with builtins; {
{lib, ...}: let
inherit (lib) mkEnableOption mkMappingOption;
in {
options.vim.lsp.lspsaga = {
enable = mkEnableOption "LSP Saga";

View File

@ -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";

View File

@ -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 [

View File

@ -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 = {

View File

@ -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;};

View File

@ -1,5 +1,6 @@
{lib, ...}:
with lib; {
{lib, ...}: let
inherit (lib) mkEnableOption mkMappingOption;
in {
options.vim.lsp = {
nvimCodeActionMenu = {
enable = mkEnableOption "nvim code action menu";

View File

@ -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;};

View File

@ -1,5 +1,6 @@
{lib, ...}:
with lib; {
{lib, ...}: let
inherit (lib) mkEnableOption mkMappingOption;
in {
options.vim.lsp = {
trouble = {
enable = mkEnableOption "trouble diagnostics viewer";