Kaynağa Gözat

lib/types: add types.nonEmptyListOf

wip-nanopi-m4v2
Robert Schütz 8 yıl önce
ebeveyn
işleme
c65e36c9ca
1 değiştirilmiş dosya ile 4 ekleme ve 0 silme
  1. +4
    -0
      lib/types.nix

+ 4
- 0
lib/types.nix Dosyayı Görüntüle

@@ -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";


Yükleniyor…
İptal
Kaydet