2011-10-27 21:36:03 +02:00
|
|
|
{ config, pkgs, ... }:
|
2009-05-28 01:14:38 +02:00
|
|
|
|
2011-10-27 21:36:03 +02:00
|
|
|
with pkgs.lib;
|
2009-05-28 01:14:38 +02:00
|
|
|
|
2011-10-27 21:36:03 +02:00
|
|
|
{
|
2009-05-28 01:14:38 +02:00
|
|
|
options = {
|
|
|
|
|
2012-07-02 21:34:27 +02:00
|
|
|
time = {
|
2013-04-22 18:56:19 +02:00
|
|
|
|
2012-07-02 21:34:27 +02:00
|
|
|
timeZone = mkOption {
|
|
|
|
default = "CET";
|
|
|
|
type = with types; uniq string;
|
|
|
|
example = "America/New_York";
|
|
|
|
description = "The time zone used when displaying times and dates.";
|
|
|
|
};
|
2009-05-28 01:14:38 +02:00
|
|
|
|
2012-07-11 21:33:34 +02:00
|
|
|
hardwareClockInLocalTime = mkOption {
|
2012-07-02 21:34:27 +02:00
|
|
|
default = false;
|
2012-07-11 21:33:34 +02:00
|
|
|
description = "If set, keep the hardware clock in local time instead of UTC.";
|
2012-07-02 21:34:27 +02:00
|
|
|
};
|
2013-04-22 18:56:19 +02:00
|
|
|
|
2012-07-02 21:34:27 +02:00
|
|
|
};
|
2009-05-28 01:14:38 +02:00
|
|
|
};
|
|
|
|
|
2011-10-27 21:36:03 +02:00
|
|
|
config = {
|
2009-05-28 01:14:38 +02:00
|
|
|
|
2011-10-27 21:36:03 +02:00
|
|
|
environment.shellInit =
|
|
|
|
''
|
2013-04-22 19:08:16 +02:00
|
|
|
export TZDIR=/etc/zoneinfo
|
2013-06-29 18:11:19 +02:00
|
|
|
export TZ=${config.time.timeZone}
|
2011-10-27 21:36:03 +02:00
|
|
|
'';
|
2009-05-28 01:14:38 +02:00
|
|
|
|
2013-04-22 19:08:16 +02:00
|
|
|
environment.etc.localtime.source = "${pkgs.tzdata}/share/zoneinfo/${config.time.timeZone}";
|
|
|
|
|
|
|
|
environment.etc.zoneinfo.source = "${pkgs.tzdata}/share/zoneinfo";
|
2013-04-22 18:56:19 +02:00
|
|
|
|
2011-10-27 21:36:03 +02:00
|
|
|
};
|
2013-04-22 18:56:19 +02:00
|
|
|
|
2009-05-28 01:14:38 +02:00
|
|
|
}
|