From f15864623a579f4af1c1b0cae14b5977283d52bd Mon Sep 17 00:00:00 2001
From: tv <tv@shackspace.de>
Date: Fri, 9 Oct 2015 14:07:29 +0200
Subject: [PATCH] krebs lib.types += suffixed-str

---
 krebs/4lib/types.nix | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/krebs/4lib/types.nix b/krebs/4lib/types.nix
index 039f803ef..b3d2c8b70 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 {