diff --git a/lib/types.nix b/lib/types.nix index 6c4a66c4e3c0b..5da3580c17b06 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -443,6 +443,11 @@ rec { descriptionClass = "noun"; check = x: str.check x && builtins.match pattern x != null; inherit (str) merge; + functor = defaultFunctor "strMatching" // { + type = payload: strMatching payload.pattern; + payload = { inherit pattern; }; + binOp = lhs: rhs: if lhs == rhs then lhs else null; + }; }; # Merge multiple definitions by concatenating them (with the given