mirror of
https://github.com/nix-community/nixvim.git
synced 2025-11-08 19:46:06 +01:00
modules/plugins: add colorschemes by-name support
This commit is contained in:
parent
4b8c8dbf91
commit
269147983c
1 changed files with 12 additions and 6 deletions
|
|
@ -2,15 +2,21 @@
|
|||
let
|
||||
inherit (builtins) readDir;
|
||||
inherit (lib.attrsets) foldlAttrs;
|
||||
inherit (lib.lists) optional;
|
||||
by-name = ../plugins/by-name;
|
||||
inherit (lib.lists) optional concatMap;
|
||||
|
||||
mkByName =
|
||||
dir:
|
||||
foldlAttrs (
|
||||
prev: name: type:
|
||||
prev ++ optional (type == "directory") (dir + "/${name}")
|
||||
) [ ] (readDir dir);
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../plugins
|
||||
]
|
||||
++ foldlAttrs (
|
||||
prev: name: type:
|
||||
prev ++ optional (type == "directory") (by-name + "/${name}")
|
||||
) [ ] (readDir by-name);
|
||||
++ concatMap mkByName [
|
||||
../colorschemes
|
||||
../plugins/by-name
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue