mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-08 22:45:30 +00:00
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.
This commit is contained in:
parent
c7a4e99837
commit
88d1e1c902
1 changed files with 12 additions and 2 deletions
|
|
@ -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 ++ ["<name>"]);
|
||||
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;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue