2014-04-14 14:26:48 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2009-05-27 23:14:38 +00:00
|
|
|
|
2014-04-14 14:26:48 +00:00
|
|
|
with lib;
|
2009-05-27 23:14:38 +00:00
|
|
|
|
2014-05-21 16:26:13 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
tzdir = "${pkgs.tzdata}/share/zoneinfo";
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2011-10-27 19:36:03 +00:00
|
|
|
{
|
2009-05-27 23:14:38 +00:00
|
|
|
options = {
|
|
|
|
|
2012-07-02 19:34:27 +00:00
|
|
|
time = {
|
2013-04-22 16:56:19 +00:00
|
|
|
|
2012-07-02 19:34:27 +00:00
|
|
|
timeZone = mkOption {
|
|
|
|
default = "CET";
|
2013-10-30 10:02:04 +00:00
|
|
|
type = types.str;
|
2012-07-02 19:34:27 +00:00
|
|
|
example = "America/New_York";
|
|
|
|
description = "The time zone used when displaying times and dates.";
|
|
|
|
};
|
2009-05-27 23:14:38 +00:00
|
|
|
|
2012-07-11 19:33:34 +00:00
|
|
|
hardwareClockInLocalTime = mkOption {
|
2012-07-02 19:34:27 +00:00
|
|
|
default = false;
|
2012-07-11 19:33:34 +00:00
|
|
|
description = "If set, keep the hardware clock in local time instead of UTC.";
|
2012-07-02 19:34:27 +00:00
|
|
|
};
|
2013-04-22 16:56:19 +00:00
|
|
|
|
2012-07-02 19:34:27 +00:00
|
|
|
};
|
2009-05-27 23:14:38 +00:00
|
|
|
};
|
|
|
|
|
2011-10-27 19:36:03 +00:00
|
|
|
config = {
|
2009-05-27 23:14:38 +00:00
|
|
|
|
2014-06-13 15:56:46 +00:00
|
|
|
environment.sessionVariables.TZDIR = "/etc/zoneinfo";
|
2009-05-27 23:14:38 +00:00
|
|
|
|
2014-05-21 16:26:13 +00:00
|
|
|
systemd.globalEnvironment.TZDIR = tzdir;
|
|
|
|
|
2014-01-06 17:23:41 +00:00
|
|
|
environment.etc.localtime =
|
2014-05-21 16:26:13 +00:00
|
|
|
{ source = "${tzdir}/${config.time.timeZone}";
|
2014-01-06 17:23:41 +00:00
|
|
|
mode = "direct-symlink";
|
|
|
|
};
|
2013-04-22 17:08:16 +00:00
|
|
|
|
|
|
|
environment.etc.zoneinfo.source = "${pkgs.tzdata}/share/zoneinfo";
|
2013-04-22 16:56:19 +00:00
|
|
|
|
2011-10-27 19:36:03 +00:00
|
|
|
};
|
2013-04-22 16:56:19 +00:00
|
|
|
|
2009-05-27 23:14:38 +00:00
|
|
|
}
|