2011-10-27 19:36:03 +00:00
|
|
|
{ config, pkgs, ... }:
|
2009-05-27 23:14:38 +00:00
|
|
|
|
2011-10-27 19:36:03 +00:00
|
|
|
with pkgs.lib;
|
2009-05-27 23:14:38 +00:00
|
|
|
|
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 = {
|
2012-07-11 19:33:34 +00:00
|
|
|
|
2012-07-02 19:34:27 +00: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-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
|
|
|
};
|
2012-07-11 19:33:34 +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
|
|
|
|
2011-10-27 19:36:03 +00:00
|
|
|
environment.shellInit =
|
|
|
|
''
|
|
|
|
export TZ=${config.time.timeZone}
|
|
|
|
export TZDIR=${pkgs.glibc}/share/zoneinfo
|
|
|
|
'';
|
2009-05-27 23:14:38 +00:00
|
|
|
|
2011-10-27 19:36:03 +00:00
|
|
|
environment.etc = singleton
|
|
|
|
{ source = "${pkgs.glibc}/share/zoneinfo/${config.time.timeZone}";
|
|
|
|
target = "localtime";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2009-05-27 23:14:38 +00:00
|
|
|
}
|