git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/config/timezone: Disallow spaces
commit7b818893947747485c14a1c5bf663b1560e7284e authorSarah Brofeldt <sbrofeldt@gmail.com> dateMon 9 Oct 2017, 20:52 (9 years ago) parent3fe7cdd
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