From 88d1e1c9021de9ccd7f2c4b83f41d9343b6e9c1b Mon Sep 17 00:00:00 2001 From: alfarel Date: Sat, 27 Sep 2025 00:21:46 +0000 Subject: [PATCH] lib/types: use `payload` instead of `wrapper` in dagOf This is the more modern approach: https://github.com/NixOS/nixpkgs/pull/375084 The above PR does this for similar cases in nixpkgs. This fixes a warning that shows up when using the lib in weird ways: ``` trace: evaluation warning: The deprecated `functor.wrapped` attribute is accessed, use `nestedTypes.elemType` instead. ``` The warning is thrown by the module system when merging types (at least in some cases). It shouldn't be exposed at all in the current codebase. --- lib/types/dag.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/types/dag.nix b/lib/types/dag.nix index a42ed513..1ecbd1ab 100644 --- a/lib/types/dag.nix +++ b/lib/types/dag.nix @@ -3,7 +3,6 @@ {lib}: let inherit (lib) - defaultFunctor nvim mkIf mkOrder @@ -62,7 +61,18 @@ in rec { inherit (elemType) getSubModules; getSubOptions = prefix: elemType.getSubOptions (prefix ++ [""]); substSubModules = m: dagOf (elemType.substSubModules m); - functor = (defaultFunctor name) // {wrapped = elemType;}; + # Based on the result of calling the nixpkgs types.nix elemTypeFunctor helper function. + functor = { + inherit name; + payload.elemType = elemType; + type = payload: types.${name} payload.elemType; + binOp = a: b: let + merged = a.elemType.typeMerge b.elemType.functor; + in + if merged == null + then null + else {elemType = merged;}; + }; nestedTypes.elemType = elemType; }; }