Merge pull request #30258 from srhb/tz-nospace
nixos/config/timezone: Disallow spaces
This commit is contained in:
commit
55bc53d1dd
@ -5,6 +5,9 @@ with lib;
|
|||||||
let
|
let
|
||||||
|
|
||||||
tzdir = "${pkgs.tzdata}/share/zoneinfo";
|
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
|
in
|
||||||
|
|
||||||
@ -15,7 +18,7 @@ in
|
|||||||
|
|
||||||
timeZone = mkOption {
|
timeZone = mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
type = types.nullOr types.str;
|
type = timezone;
|
||||||
example = "America/New_York";
|
example = "America/New_York";
|
||||||
description = ''
|
description = ''
|
||||||
The time zone used when displaying times and dates. See <link
|
The time zone used when displaying times and dates. See <link
|
||||||
|
Loading…
Reference in New Issue
Block a user