From f15864623a579f4af1c1b0cae14b5977283d52bd Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 9 Oct 2015 14:07:29 +0200 Subject: krebs lib.types += suffixed-str --- krebs/4lib/types.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'krebs') diff --git a/krebs/4lib/types.nix b/krebs/4lib/types.nix index 039f803e..b3d2c8b7 100644 --- a/krebs/4lib/types.nix +++ b/krebs/4lib/types.nix @@ -147,6 +147,13 @@ types // rec { merge = mergeOneOption; }; + suffixed-str = suffs: + mkOptionType { + name = "string suffixed by ${concatStringsSep ", " suffs}"; + check = x: isString x && any (flip hasSuffix x) suffs; + merge = mergeOneOption; + }; + user = submodule { options = { mail = mkOption { -- cgit v1.2.3