@@ -174,6 +174,13 @@ rec {
174174 merge = mergeOneOption;
175175 };
176176
177+ strMatching = pattern: mkOptionType {
178+ name = "strMatching ${escapeNixString pattern}";
179+ description = "string matching the pattern ${pattern}";
180+ check = x: str.check x && builtins.match pattern x != null;
181+ inherit (str) merge;
182+ };
183+
177184 # Merge multiple definitions by concatenating them (with the given
178185 # separator between the values).
179186 separatedString = sep: mkOptionType rec {