From c13de40f04e4c426828ec6d009f7ce5cf8d396c2 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Fri, 1 Dec 2017 17:15:10 +0000 Subject: [PATCH] tzdata: export TZDIR for dependent packages https://github.com/NixOS/nix/issues/1709 --- pkgs/data/misc/tzdata/default.nix | 2 ++ pkgs/data/misc/tzdata/tzdata-setup-hook.sh | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 pkgs/data/misc/tzdata/tzdata-setup-hook.sh diff --git a/pkgs/data/misc/tzdata/default.nix b/pkgs/data/misc/tzdata/default.nix index 1b4d967af553..ada2ed997dad 100644 --- a/pkgs/data/misc/tzdata/default.nix +++ b/pkgs/data/misc/tzdata/default.nix @@ -41,6 +41,8 @@ stdenv.mkDerivation rec { cp tzfile.h "$dev/include/tzfile.h" ''; + setupHook = ./tzdata-setup-hook.sh; + meta = { homepage = http://www.iana.org/time-zones; description = "Database of current and historical time zones"; diff --git a/pkgs/data/misc/tzdata/tzdata-setup-hook.sh b/pkgs/data/misc/tzdata/tzdata-setup-hook.sh new file mode 100644 index 000000000000..9ae9b46d85c5 --- /dev/null +++ b/pkgs/data/misc/tzdata/tzdata-setup-hook.sh @@ -0,0 +1,6 @@ +tzdataHook() { + export TZDIR=@out@/share/zoneinfo +} + +envHooks+=(tzdataHook) +crossEnvHooks+=(tzdataHook)