add doctrine

This commit is contained in:
Fabian Montero 2025-08-05 23:22:16 -06:00 committed by Alejandro Soto
parent 1c7810a49e
commit 26619394f4
No known key found for this signature in database
GPG key ID: A2C4C79764EE8F16
10 changed files with 113 additions and 63 deletions

View file

@ -0,0 +1,20 @@
{lib}: {
root,
exclude ? [],
}:
with builtins;
with lib;
# http://chriswarbo.net/projects/nixos/useful_hacks.html
let
basename = removeSuffix ".nix";
isMatch = name: type:
(hasSuffix ".nix" name || type == "directory")
&& ! elem name (map basename exclude);
entry = name: _: {
name = basename name;
value = import (root + "/${name}");
};
in
mapAttrs' entry (filterAttrs isMatch (readDir root))