From ad7b2f343896360eb8ac9fd8815304758356750a Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Tue, 22 Oct 2024 13:34:20 +0200 Subject: [PATCH] lib/types: make pattern of strMatching accessible --- lib/types.nix | 5 +++++ 1 file changed, 5 insertions(+) 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