doctrine/lib: refactor 'close' helper

This commit is contained in:
Alejandro Soto 2025-08-06 13:58:07 -06:00
parent a8ef8e43b9
commit 4d7cf46c34
No known key found for this signature in database
GPG key ID: A2C4C79764EE8F16
2 changed files with 15 additions and 4 deletions

View file

@ -3,8 +3,18 @@
doctrine, doctrine,
pkgs, pkgs,
}: let }: let
close = f: args: f (args // {inherit lib pkgs doctrine;}); close = vars: f: args:
(
if builtins.isPath f
then import f
else f
)
(args // {inherit lib pkgs doctrine;});
closeLib = close {inherit lib;};
closeFull = close {inherit lib pkgs doctrine;};
in { in {
importAll = pkgs.callPackage ./importAll.nix {}; inherit close;
mkModule = close (import ./mk-module.nix); importAll = closeLib ./importAll.nix;
mkModule = closeFull ./mk-module.nix;
} }

View file

@ -1,4 +1,5 @@
{lib}: { {
lib,
root, root,
exclude ? ["default"], exclude ? ["default"],
}: }: