mirror of
https://github.com/nix-community/nixvim.git
synced 2026-08-24 10:14:03 -05:00
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.
This commit is contained in:
+9
-1
@@ -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 { };
|
||||
|
||||
Reference in New Issue
Block a user