2014-04-14 07:26:48 -07:00
|
|
|
{ config, lib, pkgs, ... }:
|
2009-05-27 16:14:38 -07:00
|
|
|
|
2014-04-14 07:26:48 -07:00
|
|
|
with lib;
|
2009-05-27 16:14:38 -07:00
|
|
|
|
2014-05-21 09:26:13 -07:00
|
|
|
let
|
|
|
|
|
|
|
|
tzdir = "${pkgs.tzdata}/share/zoneinfo";
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2011-10-27 12:36:03 -07:00
|
|
|
{
|
2009-05-27 16:14:38 -07:00
|
|
|
options = {
|
|
|
|
|
2012-07-02 12:34:27 -07:00
|
|
|
time = {
|
2013-04-22 09:56:19 -07:00
|
|
|
|
2012-07-02 12:34:27 -07:00
|
|
|
timeZone = mkOption {
|
2014-12-15 07:28:40 -08:00
|
|
|
default = "UTC";
|
2013-10-30 03:02:04 -07:00
|
|
|
type = types.str;
|
2012-07-02 12:34:27 -07:00
|
|
|
example = "America/New_York";
|
2014-12-15 07:28:40 -08:00
|
|
|
description = ''
|
|
|
|
The time zone used when displaying times and dates. See <link
|
|
|
|
xlink:href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"/>
|
|
|
|
for a comprehensive list of possible values for this setting.
|
|
|
|
'';
|
2012-07-02 12:34:27 -07:00
|
|
|
};
|
2009-05-27 16:14:38 -07:00
|
|
|
|
2012-07-11 12:33:34 -07:00
|
|
|
hardwareClockInLocalTime = mkOption {
|
2012-07-02 12:34:27 -07:00
|
|
|
default = false;
|
2015-07-19 09:49:23 -07:00
|
|
|
type = types.bool;
|
2012-07-11 12:33:34 -07:00
|
|
|
description = "If set, keep the hardware clock in local time instead of UTC.";
|
2012-07-02 12:34:27 -07:00
|
|
|
};
|
2013-04-22 09:56:19 -07:00
|
|
|
|
2012-07-02 12:34:27 -07:00
|
|
|
};
|
2009-05-27 16:14:38 -07:00
|
|
|
};
|
|
|
|
|
2011-10-27 12:36:03 -07:00
|
|
|
config = {
|
2009-05-27 16:14:38 -07:00
|
|
|
|
2014-06-13 08:56:46 -07:00
|
|
|
environment.sessionVariables.TZDIR = "/etc/zoneinfo";
|
2009-05-27 16:14:38 -07:00
|
|
|
|
2016-10-11 04:49:38 -07:00
|
|
|
# This way services are restarted when tzdata changes.
|
2014-05-21 09:26:13 -07:00
|
|
|
systemd.globalEnvironment.TZDIR = tzdir;
|
|
|
|
|
2014-01-06 09:23:41 -08:00
|
|
|
environment.etc.localtime =
|
2016-10-11 04:49:38 -07:00
|
|
|
{ source = "/etc/zoneinfo/${config.time.timeZone}";
|
2014-01-06 09:23:41 -08:00
|
|
|
mode = "direct-symlink";
|
|
|
|
};
|
2013-04-22 10:08:16 -07:00
|
|
|
|
2016-10-11 04:49:38 -07:00
|
|
|
environment.etc.zoneinfo.source = tzdir;
|
2013-04-22 09:56:19 -07:00
|
|
|
|
2011-10-27 12:36:03 -07:00
|
|
|
};
|
2013-04-22 09:56:19 -07:00
|
|
|
|
2009-05-27 16:14:38 -07:00
|
|
|
}
|