From 085f50eac5d1056e2792d7788afeb44b3156c439 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Fri, 5 Dec 2025 11:37:49 +0000 Subject: [PATCH] lib: reimplement `call`; drop `.override` Using `callPackageWith` adds `override` and `overrideDerivation` attributes to the result, which are not relevant to subsections of Nixvim's lib section. Implement our own, simplified, `call` using `intersectAttrs` and `functionArgs`. If users wish to modify parts of our lib section, they should extend the top-level fixpoint to ensure everything stays in sync. --- lib/top-level.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 { };