1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-09 03:56:05 +01:00

modules/plugins: add colorschemes by-name support

This commit is contained in:
Heitor Augusto 2025-11-02 19:57:00 -03:00
parent 4b8c8dbf91
commit 269147983c
No known key found for this signature in database
GPG key ID: 3EEC05B0024AF8A4

View file

@ -2,15 +2,21 @@
let let
inherit (builtins) readDir; inherit (builtins) readDir;
inherit (lib.attrsets) foldlAttrs; inherit (lib.attrsets) foldlAttrs;
inherit (lib.lists) optional; inherit (lib.lists) optional concatMap;
by-name = ../plugins/by-name;
mkByName =
dir:
foldlAttrs (
prev: name: type:
prev ++ optional (type == "directory") (dir + "/${name}")
) [ ] (readDir dir);
in in
{ {
imports = [ imports = [
../plugins ../plugins
] ]
++ foldlAttrs ( ++ concatMap mkByName [
prev: name: type: ../colorschemes
prev ++ optional (type == "directory") (by-name + "/${name}") ../plugins/by-name
) [ ] (readDir by-name); ];
} }