2011-10-27 20:36:03 +01:00
|
|
|
{ config, pkgs, ... }:
|
2009-05-28 00:14:38 +01:00
|
|
|
|
2011-10-27 20:36:03 +01:00
|
|
|
with pkgs.lib;
|
2009-05-28 00:14:38 +01:00
|
|
|
|
2011-10-27 20:36:03 +01:00
|
|
|
{
|
2009-05-28 00:14:38 +01:00
|
|
|
options = {
|
|
|
|
|
2012-07-02 20:34:27 +01:00
|
|
|
time = {
|
2012-07-11 20:33:34 +01:00
|
|
|
|
2012-07-02 20:34:27 +01: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 00:14:38 +01:00
|
|
|
|
2012-07-11 20:33:34 +01:00
|
|
|
hardwareClockInLocalTime = mkOption {
|
2012-07-02 20:34:27 +01:00
|
|
|
default = false;
|
2012-07-11 20:33:34 +01:00
|
|
|
description = "If set, keep the hardware clock in local time instead of UTC.";
|
2012-07-02 20:34:27 +01:00
|
|
|
};
|
2012-07-11 20:33:34 +01:00
|
|
|
|
2012-07-02 20:34:27 +01:00
|
|
|
};
|
2009-05-28 00:14:38 +01:00
|
|
|
};
|
|
|
|
|
2011-10-27 20:36:03 +01:00
|
|
|
config = {
|
2009-05-28 00:14:38 +01:00
|
|
|
|
2011-10-27 20:36:03 +01:00
|
|
|
environment.shellInit =
|
|
|
|
''
|
|
|
|
export TZ=${config.time.timeZone}
|
2012-12-15 18:05:32 +00:00
|
|
|
export TZDIR=${pkgs.tzdata}/share/zoneinfo
|
2011-10-27 20:36:03 +01:00
|
|
|
'';
|
2009-05-28 00:14:38 +01:00
|
|
|
|
2011-10-27 20:36:03 +01:00
|
|
|
environment.etc = singleton
|
2013-03-12 09:56:43 +00:00
|
|
|
{ source = "${pkgs.tzdata}/share/zoneinfo/${config.time.timeZone}";
|
2011-10-27 20:36:03 +01:00
|
|
|
target = "localtime";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2009-05-28 00:14:38 +01:00
|
|
|
}
|