diff options
author | Robert Hensing <roberth@users.noreply.github.com> | 2021-07-23 10:45:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-23 10:45:53 +0200 |
commit | 98352288bd3c314a1a53c2da52b98931b694dd39 (patch) | |
tree | a51c4ff157b2cba8201bedd5a521235cb4596a84 /lib | |
parent | a6d966aeacd10a0e2a887e218f9b0c7df6356cae (diff) | |
parent | c971de97c4146a052b731fd47babc8be395ffdf0 (diff) |
Merge pull request #128032 from Artturin/add-swap-options
nixos/swap: add options option
Diffstat (limited to 'lib')
-rw-r--r-- | lib/types.nix | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/types.nix b/lib/types.nix index c35f055e17f58..a0be2ff3a452a 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -287,6 +287,13 @@ rec { merge = mergeEqualOption; }; + nonEmptyStr = mkOptionType { + name = "nonEmptyStr"; + description = "non-empty string"; + check = x: str.check x && builtins.match "[ \t\n]*" x == null; + inherit (str) merge; + }; + strMatching = pattern: mkOptionType { name = "strMatching ${escapeNixString pattern}"; description = "string matching the pattern ${pattern}"; |