diff options
Diffstat (limited to 'lib/types.nix')
-rw-r--r-- | lib/types.nix | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/types.nix b/lib/types.nix index f47a1f92de7..68262951a13 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -287,6 +287,13 @@ rec { merge = mergeEqualOption; }; + nonEmptyStr = mkOptionType { + name = "nonEmptyStr"; + description = "non-empty string"; + check = x: str.check x && builtins.match "[ \t\n]*" x == null; + inherit (str) merge; + }; + strMatching = pattern: mkOptionType { name = "strMatching ${escapeNixString pattern}"; description = "string matching the pattern ${pattern}"; |