git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #30258 from srhb/tz-nospace

nixos/config/timezone: Disallow spaces

commit55bc53d1dd9f99e59a8f218e98b5e484e2e6eae8 authorGraham Christensen <graham@grahamc.com> dateSat 14 Oct 2017, 10:27 (9 years ago) parenta062e327b81889
1 file changed+4−1
nixos/modules/config/timezone.nix+4−1
nixos/modules/config/timezone.nix+4−1
@@ -5,6 +5,9 @@ with lib;
55let
66
77 tzdir = "${pkgs.tzdata}/share/zoneinfo";
8+ nospace = str: filter (c: c == " ") (stringToCharacters str) == [];
9+ timezone = types.nullOr (types.addCheck types.str nospace)
10+ // { description = "null or string without spaces"; };
811
912in
1013
@@ -15,7 +18,7 @@ in
1518
1619 timeZone = mkOption {
1720 default = null;
18− type = types.nullOr types.str;
21+ type = timezone;
1922 example = "America/New_York";
2023 description = ''
2124 The time zone used when displaying times and dates. See <link