plugins/by-name: remove pathExists check

This commit is contained in:
Matt Sturgeon 2024-09-04 17:30:18 +01:00
parent 6debe9333f
commit 48e9af500c
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -1,17 +1,15 @@
{ lib, ... }: { lib, ... }:
let let
inherit (builtins) readDir pathExists; inherit (builtins) readDir;
inherit (lib.attrsets) foldlAttrs; inherit (lib.attrsets) foldlAttrs;
inherit (lib.lists) optional optionals; inherit (lib.lists) optional;
by-name = ../plugins/by-name; by-name = ../plugins/by-name;
in in
{ {
imports = imports =
[ ../plugins ] [ ../plugins ]
++ optionals (pathExists by-name) ( ++ foldlAttrs (
foldlAttrs ( prev: name: type:
prev: name: type: prev ++ optional (type == "directory") (by-name + "/${name}")
prev ++ optional (type == "directory") (by-name + "/${name}") ) [ ] (readDir by-name);
) [ ] (readDir by-name)
);
} }