diff options
| author | Alejandro Soto <alejandro@34project.org> | 2025-08-06 13:58:07 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2025-08-06 14:36:53 -0600 |
| commit | f2bffec80259b1a7902bd91166f4982edc9dc363 (patch) | |
| tree | 70fcbdee29f09b88328156d75837e66b798ff639 /doctrine/lib/default.nix | |
| parent | 6ddf84ec76f32d4e7f7bfbfbcb2595449055c7ac (diff) | |
doctrine/lib: refactor 'close' helper
Diffstat (limited to 'doctrine/lib/default.nix')
| -rw-r--r-- | doctrine/lib/default.nix | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/doctrine/lib/default.nix b/doctrine/lib/default.nix index 1b03fe1..5e2eb44 100644 --- a/doctrine/lib/default.nix +++ b/doctrine/lib/default.nix @@ -3,8 +3,18 @@ doctrine, pkgs, }: let - close = f: args: f (args // {inherit lib pkgs doctrine;}); + close = vars: f: args: + ( + if builtins.isPath f + then import f + else f + ) + (args // vars); + + closeLib = close {inherit lib;}; + closeFull = close {inherit lib pkgs doctrine;}; in { - importAll = pkgs.callPackage ./importAll.nix {}; - mkModule = close (import ./mk-module.nix); + inherit close; + importAll = closeLib ./importAll.nix; + mkModule = closeFull ./mk-module.nix; } |
