lib.types.defaultTypeMerge: Fix for functors with no wrapped attr (#476219)

This commit is contained in:
Johannes Kirschbauer
2026-04-14 07:15:44 +00:00
committed by GitHub
3 changed files with 39 additions and 2 deletions
@@ -0,0 +1,32 @@
{ lib, options, ... }:
let
fooOf =
elemType:
lib.mkOptionType {
name = "foo";
functor = {
name = "foo";
type = payload: fooOf payload.elemType;
binOp = a: _b: a;
payload.elemType = elemType;
};
};
in
{
imports = [
{
options.foo = lib.mkOption {
type = fooOf lib.types.int;
};
}
{
options.foo = lib.mkOption {
type = fooOf lib.types.int;
};
}
];
options.result = lib.mkOption {
default = builtins.seq options.foo "ok";
};
}