mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-01 21:04:30 +02:00
lib/pkg-lists: move to common location
Extract the helper functions defined in `efmls-configs-pkgs` to a common location where they can also be used by none-ls's package list.
This commit is contained in:
parent
d2aad1071f
commit
cdb2e79e51
3 changed files with 49 additions and 41 deletions
|
@ -1,4 +1,8 @@
|
|||
lib: {
|
||||
lib:
|
||||
let
|
||||
inherit (import ../../../lib/pkg-lists.nix lib) topLevel scoped;
|
||||
in
|
||||
{
|
||||
# efmls-configs tools that have no corresponding nixpkgs package
|
||||
unpackaged = [
|
||||
"blade_formatter"
|
||||
|
@ -28,20 +32,6 @@ lib: {
|
|||
|
||||
# Mapping from a efmls-configs tool name to the corresponding nixpkgs package
|
||||
packaged =
|
||||
let
|
||||
# TODO: move these helpers to a shared location so that none-ls can also use them
|
||||
topLevel = names: lib.genAttrs names lib.id;
|
||||
scoped = lib.concatMapAttrs (
|
||||
scope: v:
|
||||
if builtins.isAttrs v then
|
||||
lib.mapAttrs (_: loc: [ scope ] ++ loc) (scoped v)
|
||||
else
|
||||
lib.genAttrs (lib.toList v) (name: [
|
||||
scope
|
||||
name
|
||||
])
|
||||
);
|
||||
in
|
||||
# Top-level packages
|
||||
topLevel [
|
||||
"actionlint"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue