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, ... }:
let
inherit (builtins) readDir pathExists;
inherit (builtins) readDir;
inherit (lib.attrsets) foldlAttrs;
inherit (lib.lists) optional optionals;
inherit (lib.lists) optional;
by-name = ../plugins/by-name;
in
{
imports =
[ ../plugins ]
++ optionals (pathExists by-name) (
foldlAttrs (
prev: name: type:
prev ++ optional (type == "directory") (by-name + "/${name}")
) [ ] (readDir by-name)
);
++ foldlAttrs (
prev: name: type:
prev ++ optional (type == "directory") (by-name + "/${name}")
) [ ] (readDir by-name);
}