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, config,
lib, lib,
... ...
}: }: let
with builtins; let inherit (lib) mkOption mkEnableOption types isList nvim;
inherit (lib) mkOption mkEnableOption types;
cfg = config.vim.languages.bash; cfg = config.vim.languages.bash;
@ -70,7 +69,7 @@ in {
server = mkOption { server = mkOption {
description = "Bash LSP server to use"; description = "Bash LSP server to use";
type = with types; enum (attrNames servers); type = with types; enum (builtins.attrNames servers);
default = defaultServer; default = defaultServer;
}; };
@ -90,7 +89,7 @@ in {
}; };
type = mkOption { type = mkOption {
description = "Bash formatter to use"; description = "Bash formatter to use";
type = with types; enum (attrNames formats); type = with types; enum (builtins.attrNames formats);
default = defaultFormat; default = defaultFormat;
}; };

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkIf mkMerge;
with builtins; let
cfg = config.vim.languages.bash; cfg = config.vim.languages.bash;
diagnostics = { diagnostics = {
shellcheck = { shellcheck = {

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim optionalString mkEnableOption mkOption types mkIf mkMerge;
with builtins; let
cfg = config.vim.languages.clang; cfg = config.vim.languages.clang;
defaultServer = "ccls"; defaultServer = "ccls";
@ -93,7 +93,7 @@ in {
server = mkOption { server = mkOption {
description = "The clang LSP server to use"; description = "The clang LSP server to use";
type = with types; enum (attrNames servers); type = with types; enum (builtins.attrNames servers);
default = defaultServer; default = defaultServer;
}; };
@ -119,7 +119,7 @@ in {
}; };
debugger = mkOption { debugger = mkOption {
description = "clang debugger to use"; description = "clang debugger to use";
type = with types; enum (attrNames debuggers); type = with types; enum (builtins.attrNames debuggers);
default = defaultDebugger; default = defaultDebugger;
}; };
package = mkOption { package = mkOption {

View file

@ -3,9 +3,9 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkIf mkMerge optionalString boolToString;
with builtins; let
cfg = config.vim.languages.dart; cfg = config.vim.languages.dart;
ftcfg = cfg.flutter-tools; ftcfg = cfg.flutter-tools;
servers = { servers = {

View file

@ -3,9 +3,9 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkEnableOption mkOption types optionalString;
with builtins; let
cfg = config.vim.languages.dart; cfg = config.vim.languages.dart;
defaultServer = "dart"; defaultServer = "dart";
servers = { servers = {
@ -38,7 +38,7 @@ in {
enable = mkEnableOption "Dart LSP support"; enable = mkEnableOption "Dart LSP support";
server = mkOption { server = mkOption {
description = "The Dart LSP server to use"; description = "The Dart LSP server to use";
type = with types; enum (attrNames servers); type = with types; enum (builtins.attrNames servers);
default = defaultServer; default = defaultServer;
}; };
package = mkOption { package = mkOption {

View file

@ -3,9 +3,9 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
with lib; inherit (lib) nvim mkIf getExe;
with builtins; let
cfg = config.vim.languages.elixir; cfg = config.vim.languages.elixir;
in { in {
config = mkIf (cfg.enable) { config = mkIf (cfg.enable) {
@ -23,7 +23,7 @@ in {
-- alternatively, point to an existing elixir-ls installation (optional) -- 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"}` -- 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 -- default settings, use the `settings` function to override settings
settings = elixirls.settings { settings = elixirls.settings {

View file

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

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim getExe mkEnableOption mkOption types mkMerge mkIf;
with builtins; let
cfg = config.vim.languages.go; cfg = config.vim.languages.go;
defaultServer = "gopls"; defaultServer = "gopls";
@ -80,7 +80,7 @@ in {
server = mkOption { server = mkOption {
description = "Go LSP server to use"; description = "Go LSP server to use";
type = with types; enum (attrNames servers); type = with types; enum (builtins.attrNames servers);
default = defaultServer; default = defaultServer;
}; };
@ -100,7 +100,7 @@ in {
}; };
debugger = mkOption { debugger = mkOption {
description = "Go debugger to use"; description = "Go debugger to use";
type = with types; enum (attrNames debuggers); type = with types; enum (builtins.attrNames debuggers);
default = defaultDebugger; default = defaultDebugger;
}; };
package = mkOption { package = mkOption {

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types nvim mkIf mkMerge optional;
with builtins; let
cfg = config.vim.languages.html; cfg = config.vim.languages.html;
in { in {
options.vim.languages.html = { options.vim.languages.html = {

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge;
with builtins; let
cfg = config.vim.languages.java; cfg = config.vim.languages.java;
in { in {
options.vim.languages.java = { options.vim.languages.java = {

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString getExe;
with builtins; let
cfg = config.vim.languages.lua; cfg = config.vim.languages.lua;
in { in {
options.vim.languages.lua = { options.vim.languages.lua = {

View file

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

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types nvim;
with builtins; let
cfg = config.vim.languages.markdown; cfg = config.vim.languages.markdown;
in { in {
options.vim.languages.markdown = { options.vim.languages.markdown = {

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString;
with builtins; let
cfg = config.vim.languages.nix; cfg = config.vim.languages.nix;
useFormat = "on_attach = default_on_attach"; useFormat = "on_attach = default_on_attach";
@ -146,7 +146,7 @@ in {
type = mkOption { type = mkOption {
description = "Nix formatter to use"; description = "Nix formatter to use";
type = with types; enum (attrNames formats); type = with types; enum (builtins.attrNames formats);
default = defaultFormat; default = defaultFormat;
}; };
package = mkOption { package = mkOption {

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge getExe;
with builtins; let
cfg = config.vim.languages.php; cfg = config.vim.languages.php;
defaultServer = "phpactor"; defaultServer = "phpactor";
@ -72,7 +72,7 @@ in {
server = mkOption { server = mkOption {
description = "PHP LSP server to use"; description = "PHP LSP server to use";
type = with types; enum (attrNames servers); type = with types; enum (builtins.attrNames servers);
default = defaultServer; default = defaultServer;
}; };

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge getExe literalExpression;
with builtins; let
cfg = config.vim.languages.python; cfg = config.vim.languages.python;
defaultServer = "pyright"; defaultServer = "pyright";
@ -149,7 +149,7 @@ in {
server = mkOption { server = mkOption {
description = "Python LSP server to use"; description = "Python LSP server to use";
type = with types; enum (attrNames servers); type = with types; enum (builtins.attrNames servers);
default = defaultServer; default = defaultServer;
}; };
@ -166,7 +166,7 @@ in {
type = mkOption { type = mkOption {
description = "Python formatter to use"; description = "Python formatter to use";
type = with types; enum (attrNames formats); type = with types; enum (builtins.attrNames formats);
default = defaultFormat; default = defaultFormat;
}; };
@ -186,7 +186,7 @@ in {
}; };
debugger = mkOption { debugger = mkOption {
description = "Python debugger to use"; description = "Python debugger to use";
type = with types; enum (attrNames debuggers); type = with types; enum (builtins.attrNames debuggers);
default = defaultDebugger; default = defaultDebugger;
}; };
package = mkOption { package = mkOption {

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString boolToString optionals;
with builtins; let
cfg = config.vim.languages.rust; cfg = config.vim.languages.rust;
in { in {
options.vim.languages.rust = { options.vim.languages.rust = {

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge;
with builtins; let
cfg = config.vim.languages.sql; cfg = config.vim.languages.sql;
sqlfluffDefault = pkgs.sqlfluff; sqlfluffDefault = pkgs.sqlfluff;
@ -86,7 +86,7 @@ in {
server = mkOption { server = mkOption {
description = "SQL LSP server to use"; description = "SQL LSP server to use";
type = with types; enum (attrNames servers); type = with types; enum (builtins.attrNames servers);
default = defaultServer; default = defaultServer;
}; };
@ -103,7 +103,7 @@ in {
type = mkOption { type = mkOption {
description = "SQL formatter to use"; description = "SQL formatter to use";
type = with types; enum (attrNames formats); type = with types; enum (builtins.attrNames formats);
default = defaultFormat; default = defaultFormat;
}; };

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge;
with builtins; let
cfg = config.vim.languages.svelte; cfg = config.vim.languages.svelte;
defaultServer = "svelte"; defaultServer = "svelte";
@ -72,7 +72,7 @@ in {
server = mkOption { server = mkOption {
description = "Svelte LSP server to use"; description = "Svelte LSP server to use";
type = with types; enum (attrNames servers); type = with types; enum (builtins.attrNames servers);
default = defaultServer; default = defaultServer;
}; };
@ -89,7 +89,7 @@ in {
type = mkOption { type = mkOption {
description = "Svelte formatter to use"; description = "Svelte formatter to use";
type = with types; enum (attrNames formats); type = with types; enum (builtins.attrNames formats);
default = defaultFormat; default = defaultFormat;
}; };

View file

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

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types;
with builtins; { in {
options.vim.tidal = { options.vim.tidal = {
enable = mkEnableOption "tidalcycles tools and plugins"; enable = mkEnableOption "tidalcycles tools and plugins";

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge;
with builtins; let
cfg = config.vim.languages.ts; cfg = config.vim.languages.ts;
defaultServer = "tsserver"; defaultServer = "tsserver";
@ -98,7 +98,7 @@ in {
server = mkOption { server = mkOption {
description = "Typescript/Javascript LSP server to use"; description = "Typescript/Javascript LSP server to use";
type = with types; enum (attrNames servers); type = with types; enum (builtins.attrNames servers);
default = defaultServer; default = defaultServer;
}; };
@ -115,7 +115,7 @@ in {
type = mkOption { type = mkOption {
description = "Typescript/Javascript formatter to use"; description = "Typescript/Javascript formatter to use";
type = with types; enum (attrNames formats); type = with types; enum (builtins.attrNames formats);
default = defaultFormat; default = defaultFormat;
}; };

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) isList nvim mkEnableOption mkOption types mkIf mkMerge;
with builtins; let
cfg = config.vim.languages.zig; cfg = config.vim.languages.zig;
in { in {
options.vim.languages.zig = { options.vim.languages.zig = {

View file

@ -3,9 +3,9 @@
lib, lib,
pkgs, pkgs,
... ...
}: }: let
with lib; inherit (lib) addDescriptionsToMappings mkIf optional boolToString optionalString;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
usingNvimCmp = config.vim.autocomplete.enable && config.vim.autocomplete.type == "nvim-cmp"; usingNvimCmp = config.vim.autocomplete.enable && config.vim.autocomplete.type == "nvim-cmp";
self = import ./module.nix {inherit config lib pkgs;}; self = import ./module.nix {inherit config lib pkgs;};

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf nvim;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf (cfg.enable && cfg.lightbulb.enable) { config = mkIf (cfg.enable && cfg.lightbulb.enable) {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption;
with builtins; { in {
options.vim.lsp = { options.vim.lsp = {
lightbulb = { lightbulb = {
enable = mkEnableOption "Lightbulb for code actions. Requires an emoji font"; enable = mkEnableOption "Lightbulb for code actions. Requires an emoji font";

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf nvim optionalString;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf (cfg.enable && cfg.lspSignature.enable) { config = mkIf (cfg.enable && cfg.lspSignature.enable) {

View file

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

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf mkMerge nvim optionalString mapAttrs;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf cfg.lspconfig.enable (mkMerge [ config = mkIf cfg.lspconfig.enable (mkMerge [

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types;
with builtins; { in {
options.vim.lsp.lspconfig = { options.vim.lsp.lspconfig = {
enable = mkEnableOption "nvim-lspconfig, also enabled automatically"; enable = mkEnableOption "nvim-lspconfig, also enabled automatically";

View file

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

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
options.vim.lsp = { options.vim.lsp = {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf nvim;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf (cfg.enable && cfg.lsplines.enable) { config = mkIf (cfg.enable && cfg.lsplines.enable) {

View file

@ -1,6 +1,6 @@
{lib, ...}: {lib, ...}: let
with lib; inherit (lib) mkEnableOption;
with builtins; { in {
options.vim.lsp = { options.vim.lsp = {
lsplines = { lsplines = {
enable = mkEnableOption "diagnostics using virtual lines on top of the real line of code. [lsp_lines]"; enable = mkEnableOption "diagnostics using virtual lines on top of the real line of code. [lsp_lines]";

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) addDescriptionsToMappings mkIf mkSetLuaBinding mkMerge nvim optionalString;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
self = import ./lspsaga.nix {inherit lib;}; self = import ./lspsaga.nix {inherit lib;};

View file

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

View file

@ -1,6 +1,5 @@
{lib, ...}: {lib, ...}: let
with lib; inherit (lib) mkEnableOption mkMappingOption;
with builtins; let
in { in {
options.vim.lsp = { options.vim.lsp = {
enable = mkEnableOption "LSP, also enabled automatically through null-ls and lspconfig options"; enable = mkEnableOption "LSP, also enabled automatically through null-ls and lspconfig options";

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkIf mkMerge nvim mapAttrs;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
config = mkIf cfg.null-ls.enable (mkMerge [ config = mkIf cfg.null-ls.enable (mkMerge [

View file

@ -3,9 +3,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) mkEnableOption mkOption types;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
in { in {
options.vim.lsp.null-ls = { options.vim.lsp.null-ls = {

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) addDescriptionsToMappings mkIf mkSetBinding nvim;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
self = import ./nvim-code-action-menu.nix {inherit lib;}; self = import ./nvim-code-action-menu.nix {inherit lib;};

View file

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

View file

@ -2,9 +2,9 @@
config, config,
lib, lib,
... ...
}: }: let
with lib; inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim;
with builtins; let
cfg = config.vim.lsp; cfg = config.vim.lsp;
self = import ./trouble.nix {inherit lib;}; self = import ./trouble.nix {inherit lib;};

View file

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