Tcl's TimeZoneinfo in NixOS

My NixOS:

eltclsh > nixos-version 
23.11pre497256.86a9533155e (Tapir)

I have installed Tcl, and trying to do

eltclsh > set t [clock scan {2004-10-30 05:00:00} \
-format {%Y-%m-%d %H:%M:%S} \
-timezone :America/New_York]
time zone ":America/New_York" not found

Here I found that:

The current set of places where tcl will try to find Olson files is:

   /usr/share/zoneinfo
   /user/share/lib/zoneinfo
   /user/lib/zoneinfo
   /user/local/etc/zoneinfo
   C:/Progra~1/cygwin/usr/local/etc/zoneinfo

But in my NixOS there is only /etc/zoneinfo. What can I do for fixing that problem?

An ugly workaround is to make an symlink to /etc/zoneinfo:

> sudo mkdir /usr/share/
> sudo ln -s /etc/zoneinfo /usr/share/zoneinfo
eltclsh > set t [clock scan {2004-10-30 05:00:00} \
-format {%Y-%m-%d %H:%M:%S} \
-timezone :America/New_York]
1099126800

But it is not the NixOS way. How can I create an symlink by /etc/nixos/configuration.nix?

1 Like

As a quick fix it seems like the tcl package should be patched to include our location instead. Adding our location here seems like it might do the trick.

A better long term solution would be to work with upstream to get our path added to that list… though tcl releases aren’t that common these days, so maybe I’m being idealistic by saying this :laughing:

You can’t get a store path into upstream.

I’ve started an issue and a PR to fix; please like, subscribe, and review, thx.

The original post stated we have a stable path under /etc.

:man_shrugging: