mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-30 04:14:28 +02:00
plugins/none-ls: use defaultText
in package options
This commit is contained in:
parent
a8a7e405f4
commit
d2aad1071f
3 changed files with 219 additions and 168 deletions
|
@ -8,8 +8,9 @@ sourceType: sourceName:
|
|||
...
|
||||
}:
|
||||
let
|
||||
inherit (import ./packages.nix pkgs) packaged;
|
||||
inherit (import ./packages.nix lib) packaged;
|
||||
pkg = packaged.${sourceName};
|
||||
loc = lib.toList pkg;
|
||||
|
||||
cfg = config.plugins.none-ls;
|
||||
cfg' = config.plugins.none-ls.sources.${sourceType}.${sourceName};
|
||||
|
@ -55,7 +56,12 @@ in
|
|||
''
|
||||
));
|
||||
}
|
||||
// lib.optionalAttrs (pkg != null) { default = pkg; }
|
||||
// lib.optionalAttrs (pkg != null) {
|
||||
default =
|
||||
lib.attrByPath loc (lib.warn "${lib.concatStringsSep "." loc} cannot be found in pkgs!" null)
|
||||
pkgs;
|
||||
defaultText = lib.literalExpression "pkgs.${lib.concatStringsSep "." loc}";
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue