{
  lib,
  doctrine,
  pkgs,
}: let
  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
  {
    inherit close;
    importAll = closeLib ./import-all.nix;
  }
  // lib.optionalAttrs (doctrine.namespace != null) {
    mkModule = closeFull ./mk-module.nix;
  }
