[Nix-dev] should libc depend on tzdata

Mihaly Barasz klao at nilcons.com
Tue Apr 29 15:54:47 CEST 2014


On Tue, Apr 29, 2014 at 3:43 PM, Eelco Dolstra
<eelco.dolstra at logicblox.com> wrote:
> Hi,
>
> On 29/04/14 15:25, Mihaly Barasz wrote:
>
>> Lately I've been paying more attention to the time zone handling in
>> Nix and I realized something that strikes me as weird. I've been
>> bumping into this before, but didn't pay much attention. The issue is
>> the following:
>>
>> To get proper time zone handling in Nix/NixOS you _have to_ have the
>> TZDIR environment variable set.
>
> You only need $TZDIR if you also set $TZ, which NixOS doesn't do. If $TZ is not
> set, then Glibc will use /etc/localtime, which is a symlink to the appropriate
> zone info file.

Of course. But, I think that it's much more common to set $TZ than $TZDIR.
For example, a lot of my scripts start with
export TZ=UTC
or
export TZ=America/New_York
to have them work consistently across machines.
Actually, I didn't even know about TZDIR before coming in touch with
Nix where my stuff stopped working. :)

Mihaly


More information about the nix-dev mailing list