diff --git a/lib/top-level.nix b/lib/top-level.nix index c84c54ab..05e34e97 100644 --- a/lib/top-level.nix +++ b/lib/top-level.nix @@ -22,13 +22,21 @@ lib.makeExtensible ( self: let # Used when importing parts of our lib - call = lib.callPackageWith { + autoArgs = { inherit call self lib ; }; + + call = + fnOrFile: + let + fn = if builtins.isPath fnOrFile then import fnOrFile else fnOrFile; + fnAutoArgs = builtins.intersectAttrs (builtins.functionArgs fn) autoArgs; + in + args: fn (fnAutoArgs // args); in { autocmd = call ./autocmd-helpers.nix { };