mirror of
https://github.com/nix-community/nixvim.git
synced 2026-09-26 09:10:37 -04:00
plugins/null-ls: migrate null-ls to none-ls
This commit is contained in:
+1
-1
@@ -72,7 +72,7 @@
|
||||
./lsp/nvim-lightbulb.nix
|
||||
./lsp/trouble.nix
|
||||
|
||||
./null-ls
|
||||
./none-ls
|
||||
|
||||
./dap
|
||||
|
||||
|
||||
@@ -5,22 +5,27 @@
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.plugins.null-ls;
|
||||
cfg = config.plugins.none-ls;
|
||||
helpers = import ../helpers.nix {inherit lib;};
|
||||
in {
|
||||
imports = [
|
||||
./servers.nix
|
||||
(
|
||||
mkRenamedOptionModule
|
||||
["plugins" "null-ls"]
|
||||
["plugins" "none-ls"]
|
||||
)
|
||||
];
|
||||
|
||||
options.plugins.null-ls =
|
||||
options.plugins.none-ls =
|
||||
helpers.extraOptionsOptions
|
||||
// {
|
||||
enable = mkEnableOption "null-ls";
|
||||
enable = mkEnableOption "none-ls";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.vimPlugins.null-ls-nvim;
|
||||
description = "Plugin to use for null-ls";
|
||||
default = pkgs.vimPlugins.none-ls-nvim;
|
||||
description = "Plugin to use for none-ls";
|
||||
};
|
||||
|
||||
border = helpers.defaultNullOpts.mkBorder "null" "`:NullLsInfo` UI window." ''
|
||||
@@ -7,7 +7,7 @@
|
||||
mkServer = {
|
||||
name,
|
||||
sourceType,
|
||||
description ? "${name} source, for null-ls.",
|
||||
description ? "${name} source, for none-ls.",
|
||||
package ? null,
|
||||
extraPackages ? [],
|
||||
...
|
||||
@@ -21,7 +21,7 @@
|
||||
} @ args:
|
||||
with lib; let
|
||||
helpers = import ../helpers.nix args;
|
||||
cfg = config.plugins.null-ls.sources.${sourceType}.${name};
|
||||
cfg = config.plugins.none-ls.sources.${sourceType}.${name};
|
||||
# does this evaluate package?
|
||||
packageOption =
|
||||
if package == null
|
||||
@@ -30,11 +30,11 @@
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = package;
|
||||
description = "Package to use for ${name} by null-ls";
|
||||
description = "Package to use for ${name} by none-ls";
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.plugins.null-ls.sources.${sourceType}.${name} =
|
||||
options.plugins.none-ls.sources.${sourceType}.${name} =
|
||||
{
|
||||
enable = mkEnableOption description;
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
extraPackages = extraPackages ++ optional (package != null) cfg.package;
|
||||
|
||||
# Add source to list of sources
|
||||
plugins.null-ls.sourcesItems = let
|
||||
plugins.none-ls.sourcesItems = let
|
||||
sourceItem = "${sourceType}.${name}";
|
||||
withArgs =
|
||||
if (cfg.withArgs == null)
|
||||
@@ -161,7 +161,7 @@ in {
|
||||
imports = lib.lists.map helpers.mkServer dataFlattened;
|
||||
|
||||
config = let
|
||||
cfg = config.plugins.null-ls;
|
||||
cfg = config.plugins.none-ls;
|
||||
gitsignsEnabled = cfg.sources.code_actions.gitsigns.enable;
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
@@ -1,21 +1,21 @@
|
||||
{
|
||||
# Empty configuration
|
||||
empty = {
|
||||
plugins.null-ls.enable = true;
|
||||
plugins.none-ls.enable = true;
|
||||
};
|
||||
|
||||
# Broken:
|
||||
# error: The option `plugins.null-ls.sources.formatting.beautysh' does not exist.
|
||||
# error: The option `plugins.none-ls.sources.formatting.beautysh' does not exist.
|
||||
#
|
||||
# beautysh = {
|
||||
# plugins.null-ls = {
|
||||
# plugins.none-ls = {
|
||||
# enable = true;
|
||||
# sources.formatting.beautysh.enable = true;
|
||||
# };
|
||||
# };
|
||||
|
||||
default = {
|
||||
plugins.null-ls = {
|
||||
plugins.none-ls = {
|
||||
enable = true;
|
||||
border = null;
|
||||
cmd = ["nvim"];
|
||||
Reference in New Issue
Block a user