diff options
author | tv <tv@shackspace.de> | 2015-10-09 14:07:29 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-10-09 14:07:29 +0200 |
commit | f15864623a579f4af1c1b0cae14b5977283d52bd (patch) | |
tree | 779605114dbead5dab04e1d92b982df10be6565b /krebs/4lib/types.nix | |
parent | 87fa7792e3f2debeb221073b393a7909a75a9176 (diff) |
krebs lib.types += suffixed-str
Diffstat (limited to 'krebs/4lib/types.nix')
-rw-r--r-- | krebs/4lib/types.nix | 7 |
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 { |