mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 06:45:16 +01:00
945849b86f
We don't need to set $TZ, because we have /etc/localtime. In fact, setting $TZ without $TZDIR doesn't work anymore since Glibc no longer contains zone info.
39 lines
735 B
Nix
39 lines
735 B
Nix
{ config, pkgs, ... }:
|
|
|
|
with pkgs.lib;
|
|
|
|
{
|
|
options = {
|
|
|
|
time = {
|
|
|
|
timeZone = mkOption {
|
|
default = "CET";
|
|
type = with types; uniq string;
|
|
example = "America/New_York";
|
|
description = "The time zone used when displaying times and dates.";
|
|
};
|
|
|
|
hardwareClockInLocalTime = mkOption {
|
|
default = false;
|
|
description = "If set, keep the hardware clock in local time instead of UTC.";
|
|
};
|
|
|
|
};
|
|
};
|
|
|
|
config = {
|
|
|
|
environment.shellInit =
|
|
''
|
|
export TZDIR=${pkgs.tzdata}/share/zoneinfo
|
|
'';
|
|
|
|
environment.etc = singleton
|
|
{ source = "${pkgs.tzdata}/share/zoneinfo/${config.time.timeZone}";
|
|
target = "localtime";
|
|
};
|
|
|
|
};
|
|
|
|
}
|