mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugins/none-ls: combine packaged+unpackaged lists
We can just make `packaged` nullable again.
This commit is contained in:
parent
d8f3113e90
commit
4f3cd9f368
3 changed files with 223 additions and 226 deletions
|
@ -5,7 +5,7 @@
|
|||
pkgs,
|
||||
}:
|
||||
let
|
||||
inherit (import ../../plugins/none-ls/packages.nix pkgs) packaged noPackage unpackaged;
|
||||
inherit (import ../../plugins/none-ls/packages.nix pkgs) packaged noPackage;
|
||||
|
||||
builtinSources = lib.trivial.importJSON "${vimPlugins.none-ls-nvim.src}/doc/builtins.json";
|
||||
|
||||
|
@ -14,11 +14,11 @@ let
|
|||
toolNames = lib.unique (lib.flatten (lib.attrValues builtinSourceNames));
|
||||
|
||||
undeclaredTool = lib.filter (
|
||||
name: !(lib.hasAttr name packaged || lib.elem name noPackage || lib.elem name unpackaged)
|
||||
name: !(lib.hasAttr name packaged || lib.elem name noPackage)
|
||||
) toolNames;
|
||||
|
||||
uselesslyDeclaredTool = lib.filter (name: !(lib.elem name toolNames)) (
|
||||
unpackaged ++ noPackage ++ (lib.attrNames packaged)
|
||||
noPackage ++ (lib.attrNames packaged)
|
||||
);
|
||||
in
|
||||
writeText "efmls-configs-sources.nix" (
|
||||
|
|
|
@ -8,7 +8,8 @@ sourceType: sourceName:
|
|||
...
|
||||
}:
|
||||
let
|
||||
inherit (import ./packages.nix pkgs) packaged unpackaged;
|
||||
inherit (import ./packages.nix pkgs) packaged;
|
||||
pkg = packaged.${sourceName};
|
||||
|
||||
cfg = config.plugins.none-ls;
|
||||
cfg' = config.plugins.none-ls.sources.${sourceType}.${sourceName};
|
||||
|
@ -22,12 +23,8 @@ in
|
|||
'';
|
||||
}
|
||||
# Only declare a package option if a package is required
|
||||
// lib.optionalAttrs (packaged ? ${sourceName} || lib.elem sourceName unpackaged) {
|
||||
package =
|
||||
let
|
||||
pkg = packaged.${sourceName} or null;
|
||||
in
|
||||
lib.mkOption (
|
||||
// lib.optionalAttrs (packaged ? ${sourceName}) {
|
||||
package = lib.mkOption (
|
||||
{
|
||||
type = lib.types.nullOr lib.types.package;
|
||||
description =
|
||||
|
|
|
@ -1,46 +1,4 @@
|
|||
pkgs: {
|
||||
# builtin sources that are not packaged in nixpkgs
|
||||
unpackaged = [
|
||||
"blade_formatter"
|
||||
"bsfmt"
|
||||
"bslint"
|
||||
"cljstyle"
|
||||
"cueimports"
|
||||
"erb_lint"
|
||||
"findent"
|
||||
"forge_fmt"
|
||||
"gccdiag"
|
||||
"gersemi"
|
||||
"markuplint"
|
||||
"mlint"
|
||||
"nginx_beautifier"
|
||||
"npm_groovy_lint"
|
||||
"ocdc"
|
||||
"packer"
|
||||
"perlimports"
|
||||
"pint"
|
||||
"pretty_php"
|
||||
"purs_tidy"
|
||||
"pyink"
|
||||
"reek"
|
||||
"regal"
|
||||
"remark"
|
||||
"rescript"
|
||||
"saltlint"
|
||||
"solhint"
|
||||
"spectral"
|
||||
"sqlfmt"
|
||||
"sql_formatter"
|
||||
"styler"
|
||||
"stylint"
|
||||
"swiftformat"
|
||||
"swiftlint"
|
||||
"textidote"
|
||||
"textlint"
|
||||
"twigcs"
|
||||
"vacuum"
|
||||
];
|
||||
|
||||
# builtin sources that don't require a package
|
||||
noPackage = [
|
||||
"gitrebase"
|
||||
|
@ -60,7 +18,8 @@ pkgs: {
|
|||
];
|
||||
|
||||
# nixpkgs packages for a given source
|
||||
packaged = {
|
||||
packaged =
|
||||
{
|
||||
inherit (pkgs)
|
||||
actionlint
|
||||
alejandra
|
||||
|
@ -218,5 +177,46 @@ pkgs: {
|
|||
vint = pkgs.vim-vint;
|
||||
write_good = pkgs.write-good;
|
||||
xmllint = pkgs.libxml2;
|
||||
};
|
||||
}
|
||||
# builtin sources that are not packaged in nixpkgs
|
||||
// pkgs.lib.genAttrs [
|
||||
"blade_formatter"
|
||||
"bsfmt"
|
||||
"bslint"
|
||||
"cljstyle"
|
||||
"cueimports"
|
||||
"erb_lint"
|
||||
"findent"
|
||||
"forge_fmt"
|
||||
"gccdiag"
|
||||
"gersemi"
|
||||
"markuplint"
|
||||
"mlint"
|
||||
"nginx_beautifier"
|
||||
"npm_groovy_lint"
|
||||
"ocdc"
|
||||
"packer"
|
||||
"perlimports"
|
||||
"pint"
|
||||
"pretty_php"
|
||||
"purs_tidy"
|
||||
"pyink"
|
||||
"reek"
|
||||
"regal"
|
||||
"remark"
|
||||
"rescript"
|
||||
"saltlint"
|
||||
"solhint"
|
||||
"spectral"
|
||||
"sqlfmt"
|
||||
"sql_formatter"
|
||||
"styler"
|
||||
"stylint"
|
||||
"swiftformat"
|
||||
"swiftlint"
|
||||
"textidote"
|
||||
"textlint"
|
||||
"twigcs"
|
||||
"vacuum"
|
||||
] (_: null);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue