1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-12 13:36:06 +01:00

modules/plugins: add colorschemes by-name support

This commit is contained in:
Heitor Augusto 2025-11-02 19:57:00 -03:00 committed by Gaétan Lepage
parent 2b9d7f419e
commit 00a40d1a0a

View file

@ -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
];
}