Go: zoneinfo.zip wrong path update in build


On Jan 25th I entered this bug report

Go: update path to zoneinfo.zip

but I didn’t get any updates on it so I thought I should bring it up here (I hope this is the right place).

The summary is that a go program that uses timezone information, compiled using nix-shell, cannot run on a different server.

Because the go nix package updates the go source code (not my program, but the language itself) and replaces the path




But my servers don’t have the nix path, they have the default /usr/share/zoneinfo path (Ubuntu and prob others use the same).

The ticket has more details and I’m happy to paste them here is that is better.




Possibly relevant: Building an executable with Nix that can run on Ubuntu 16.04


How do you deploy your application? Binaries built with Nix should be also deployed with Nix, not just copied around.

Read about things like:


There could be a disconnect between how Go developers are used to working with and the Nix way of doing things. But Go application are meant to be simply copied around. The Go language and tools let you even compile, on a Linux machine, a binary that will run on Windows or Mac, without having to get any special compiler or VM on the target/build machine.

And regarding the particular ticket I entered, right now when nix installs the Go language, it changes “one” of the path where the language looks for timezone data, and replaces it with the nix one, but leaves a few others. That is why I thought it would be great if instead of picking that one entry and replace it, nix would prepend the nix path, so a 100% Nix shop runs fine, but those of us who have a mixed environment can also work ok without having to bring in a lot of extra files/use other modules.