lib/types: add types.nonEmptyListOf

wip/yesman
Robert Schütz 6 years ago
parent e860b651d6
commit c65e36c9ca
  1. 4
      lib/types.nix

@ -256,6 +256,10 @@ rec {
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";

Loading…
Cancel
Save