summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-10-09 14:07:29 +0200
committertv <tv@shackspace.de>2015-10-09 14:07:29 +0200
commitf15864623a579f4af1c1b0cae14b5977283d52bd (patch)
tree779605114dbead5dab04e1d92b982df10be6565b
parent87fa7792e3f2debeb221073b393a7909a75a9176 (diff)
krebs lib.types += suffixed-str
-rw-r--r--krebs/4lib/types.nix7
1 files changed, 7 insertions, 0 deletions
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 {