Skip to content

Commit

Permalink
lib/types: use elemTypeFunctor for types.listOf
Browse files Browse the repository at this point in the history
  • Loading branch information
hsjobeki committed Jan 6, 2025
1 parent 3aae1bf commit 66be74f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,9 @@ rec {
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["*"]);
getSubModules = elemType.getSubModules;
substSubModules = m: listOf (elemType.substSubModules m);
functor = (defaultFunctor name) // { wrapped = elemType; };
functor = (elemTypeFunctor name { inherit elemType; }) // {
type = payload: types.listOf payload.elemType;
};
nestedTypes.elemType = elemType;
};

Expand Down Expand Up @@ -686,7 +688,8 @@ rec {
substSubModules = m: attrsWith { elemType = elemType.substSubModules m; inherit lazy placeholder; };
functor = (elemTypeFunctor "attrsWith" {
inherit elemType lazy placeholder;
};
}) // {
# Custom type merging required because of the "placeholder" attribute
inherit binOp;
};
nestedTypes.elemType = elemType;
Expand Down

0 comments on commit 66be74f

Please sign in to comment.