lib/types: add types.nonEmptyListOf

Changed files
+4
lib
+4
lib/types.nix
···
functor = (defaultFunctor name) // { wrapped = elemType; };
};
attrsOf = elemType: mkOptionType rec {
name = "attrsOf";
description = "attribute set of ${elemType.description}s";
···
functor = (defaultFunctor name) // { wrapped = elemType; };
};
+
nonEmptyListOf = elemType:
+
let list = addCheck (types.listOf elemType) (l: l != []);
+
in list // { description = "non-empty " + list.description; };
+
attrsOf = elemType: mkOptionType rec {
name = "attrsOf";
description = "attribute set of ${elemType.description}s";