diff options
author | Graham Christensen <graham@grahamc.com> | 2017-10-14 10:27:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-14 10:27:09 -0400 |
commit | 55bc53d1dd9f99e59a8f218e98b5e484e2e6eae8 (patch) | |
tree | 3bd1c45c067e5a43605f28286e17cfe043af1528 /nixos/modules/config | |
parent | a062e325b0a12a1ea3c20be78ada1e9a89d48a68 (diff) | |
parent | 7b818893947747485c14a1c5bf663b1560e7284e (diff) | |
download | nixlib-55bc53d1dd9f99e59a8f218e98b5e484e2e6eae8.tar nixlib-55bc53d1dd9f99e59a8f218e98b5e484e2e6eae8.tar.gz nixlib-55bc53d1dd9f99e59a8f218e98b5e484e2e6eae8.tar.bz2 nixlib-55bc53d1dd9f99e59a8f218e98b5e484e2e6eae8.tar.lz nixlib-55bc53d1dd9f99e59a8f218e98b5e484e2e6eae8.tar.xz nixlib-55bc53d1dd9f99e59a8f218e98b5e484e2e6eae8.tar.zst nixlib-55bc53d1dd9f99e59a8f218e98b5e484e2e6eae8.zip |
Merge pull request #30258 from srhb/tz-nospace
nixos/config/timezone: Disallow spaces
Diffstat (limited to 'nixos/modules/config')
-rw-r--r-- | nixos/modules/config/timezone.nix | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/modules/config/timezone.nix b/nixos/modules/config/timezone.nix index aa030a816d04..b15948f6e2e5 100644 --- a/nixos/modules/config/timezone.nix +++ b/nixos/modules/config/timezone.nix @@ -5,6 +5,9 @@ with lib; let tzdir = "${pkgs.tzdata}/share/zoneinfo"; + nospace = str: filter (c: c == " ") (stringToCharacters str) == []; + timezone = types.nullOr (types.addCheck types.str nospace) + // { description = "null or string without spaces"; }; in @@ -15,7 +18,7 @@ in timeZone = mkOption { default = null; - type = types.nullOr types.str; + type = timezone; example = "America/New_York"; description = '' The time zone used when displaying times and dates. See <link |