Skip to content

Commit

Permalink
treewide: move missing modules from 'with lib' to 'inherit (lib) ...'
Browse files Browse the repository at this point in the history
  • Loading branch information
FrothyMarrow committed Nov 8, 2023
1 parent 4700a98 commit 7518c31
Show file tree
Hide file tree
Showing 43 changed files with 146 additions and 146 deletions.
9 changes: 4 additions & 5 deletions modules/languages/bash/bash.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
};

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

Expand Down
6 changes: 3 additions & 3 deletions modules/languages/bash/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) isList nvim mkIf mkMerge;

cfg = config.vim.languages.bash;
diagnostics = {
shellcheck = {
Expand Down
10 changes: 5 additions & 5 deletions modules/languages/clang.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) isList nvim optionalString mkEnableOption mkOption types mkIf mkMerge;

cfg = config.vim.languages.clang;

defaultServer = "ccls";
Expand Down Expand Up @@ -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;
};

Expand All @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions modules/languages/dart/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) isList nvim mkIf mkMerge optionalString boolToString;

cfg = config.vim.languages.dart;
ftcfg = cfg.flutter-tools;
servers = {
Expand Down
8 changes: 4 additions & 4 deletions modules/languages/dart/dart.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) isList nvim mkEnableOption mkOption types optionalString;

cfg = config.vim.languages.dart;
defaultServer = "dart";
servers = {
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions modules/languages/elixir/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) nvim mkIf getExe;

cfg = config.vim.languages.elixir;
in {
config = mkIf (cfg.enable) {
Expand All @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions modules/languages/elixir/elixir-tools.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.languages.elixir = {
enable = mkEnableOption "Elixir language support";
};
Expand Down
10 changes: 5 additions & 5 deletions modules/languages/go.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) isList nvim getExe mkEnableOption mkOption types mkMerge mkIf;

cfg = config.vim.languages.go;

defaultServer = "gopls";
Expand Down Expand Up @@ -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;
};

Expand All @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions modules/languages/html.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 nvim mkIf mkMerge optional;

cfg = config.vim.languages.html;
in {
options.vim.languages.html = {
Expand Down
6 changes: 3 additions & 3 deletions modules/languages/java.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) isList nvim mkEnableOption mkOption types mkIf mkMerge;

cfg = config.vim.languages.java;
in {
options.vim.languages.java = {
Expand Down
6 changes: 3 additions & 3 deletions modules/languages/lua.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) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString getExe;

cfg = config.vim.languages.lua;
in {
options.vim.languages.lua = {
Expand Down
6 changes: 3 additions & 3 deletions modules/languages/markdown/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) nvim mkIf mkMerge;

cfg = config.vim.languages.markdown;
in {
config = mkIf cfg.enable (mkMerge [
Expand Down
6 changes: 3 additions & 3 deletions modules/languages/markdown/markdown.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 nvim;

cfg = config.vim.languages.markdown;
in {
options.vim.languages.markdown = {
Expand Down
8 changes: 4 additions & 4 deletions modules/languages/nix.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) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString;

cfg = config.vim.languages.nix;

useFormat = "on_attach = default_on_attach";
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions modules/languages/php.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) isList nvim mkEnableOption mkOption types mkIf mkMerge getExe;

cfg = config.vim.languages.php;

defaultServer = "phpactor";
Expand Down Expand Up @@ -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;
};

Expand Down
12 changes: 6 additions & 6 deletions modules/languages/python.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) isList nvim mkEnableOption mkOption types mkIf mkMerge getExe literalExpression;

cfg = config.vim.languages.python;

defaultServer = "pyright";
Expand Down Expand Up @@ -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;
};

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

Expand All @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions modules/languages/rust.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) isList nvim mkEnableOption mkOption types mkIf mkMerge optionalString boolToString optionals;

cfg = config.vim.languages.rust;
in {
options.vim.languages.rust = {
Expand Down
10 changes: 5 additions & 5 deletions modules/languages/sql.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) isList nvim mkEnableOption mkOption types mkIf mkMerge;

cfg = config.vim.languages.sql;
sqlfluffDefault = pkgs.sqlfluff;

Expand Down Expand Up @@ -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;
};

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

Expand Down
10 changes: 5 additions & 5 deletions modules/languages/svelte.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) isList nvim mkEnableOption mkOption types mkIf mkMerge;

cfg = config.vim.languages.svelte;

defaultServer = "svelte";
Expand Down Expand Up @@ -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;
};

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

Expand Down
Loading

0 comments on commit 7518c31

Please sign in to comment.