diff --git a/docs/default.nix b/docs/default.nix index 2c6e4343..c94b6f9b 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -13,8 +13,6 @@ let // { getSubOptions = prefix: (t1.getSubOptions prefix) // (t2.getSubOptions prefix); }; - - eitherRecursive = t1: t2: (final.types.either t1 t2) // { getSubOptions = _: { }; }; }; } ); diff --git a/lib/extend-lib.nix b/lib/extend-lib.nix index 960cc0c4..2168085e 100644 --- a/lib/extend-lib.nix +++ b/lib/extend-lib.nix @@ -13,6 +13,6 @@ lib.extend ( maintainers = prev.maintainers // import ./maintainers.nix; # Merge in our custom types - types = call ./types.nix { } // prev.types; + types = prev.types // call ./types.nix { }; } ) diff --git a/lib/types.nix b/lib/types.nix index 55f3b13d..a7d57f08 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -95,8 +95,15 @@ rec { strLua = strLikeType "lua code string"; strLuaFn = strLikeType "lua function string"; - # Overridden when building the documentation - eitherRecursive = types.either; + # When building the documentation `either` is extended to return the nestedType's sub-options + # This type can be used to avoid infinite recursion when evaluating the docs + # TODO: consider deprecating this in favor of using `config.isDocs` in option declarations + eitherRecursive = + t1: t2: + types.either t1 t2 + // { + getSubOptions = _: { }; + }; listOfLen = elemType: len: