diff options
Diffstat (limited to 'nixos/modules/config/timezone.nix')
-rw-r--r-- | nixos/modules/config/timezone.nix | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/nixos/modules/config/timezone.nix b/nixos/modules/config/timezone.nix new file mode 100644 index 000000000000..07a76d9ad1fa --- /dev/null +++ b/nixos/modules/config/timezone.nix @@ -0,0 +1,36 @@ +{ config, pkgs, ... }: + +with pkgs.lib; + +{ + options = { + + time = { + + timeZone = mkOption { + default = "CET"; + type = types.str; + example = "America/New_York"; + description = "The time zone used when displaying times and dates."; + }; + + hardwareClockInLocalTime = mkOption { + default = false; + description = "If set, keep the hardware clock in local time instead of UTC."; + }; + + }; + }; + + config = { + + environment.variables.TZDIR = "/etc/zoneinfo"; + environment.variables.TZ = config.time.timeZone; + + environment.etc.localtime.source = "${pkgs.tzdata}/share/zoneinfo/${config.time.timeZone}"; + + environment.etc.zoneinfo.source = "${pkgs.tzdata}/share/zoneinfo"; + + }; + +} |