diff options
| author | tv <tv@krebsco.de> | 2023-02-05 00:41:47 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2023-02-05 01:40:20 +0100 |
| commit | 889a27da7e532cfff95c684cc137b009545288c7 (patch) | |
| tree | 02d91c3f5507a554e90407e8674193daff3ef519 /lib/types.nix | |
| parent | ffb24500ef54ff15b87b497c4a9ae71e7c6f4ec4 (diff) | |
lib.types.svg.color-keyword: init
Diffstat (limited to 'lib/types.nix')
| -rw-r--r-- | lib/types.nix | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/types.nix b/lib/types.nix index f7c4916..4bb8c17 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -3,8 +3,8 @@ let inherit (lib) all any attrNames concatMapStringsSep concatStringsSep const filter flip - genid_uint31 hasSuffix head isInt isString length mergeOneOption mkOption - mkOptionType optional optionalAttrs optionals range splitString + genid_uint31 hasSuffix head importJSON isInt isString length mergeOneOption + mkOption mkOptionType optional optionalAttrs optionals range splitString stringLength substring test testString typeOf; inherit (lib.types) attrsOf bool either enum int lines listOf nullOr path str submodule; @@ -613,6 +613,19 @@ rec { merge = mergeOneOption; }; + # SVG 1.1, 4.4 Recognized color keyword names + # + # svg-colors.json has been generated with: + # curl -sS https://www.w3.org/TR/SVG11/types.html#ColorKeywords | + # fq -d html '[ + # grep_by(.["@class"]=="color-keywords") | + # grep_by(.["@class"]=="prop-value"and.["#text"]!="").["#text"] + # ] | sort' + # + svg.color-keyword = enum (importJSON ./svg-colors.json) // { + name = "SVG 1.1 recognized color keyword"; + }; + systemd.unit-name = mkOptionType { name = "systemd unit name"; check = x: |
