mirror of
https://github.com/nix-community/nixvim.git
synced 2025-12-08 01:51:05 +01: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:
parent
8e85c25143
commit
085f50eac5
1 changed files with 9 additions and 1 deletions
|
|
@ -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 { };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue