From 7fd13ddc66a0dfa07dd0eadf3c5a01ce28cc41f1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 21 May 2014 18:26:13 +0200 Subject: [PATCH] Set TZDIR for all systemd services This only matters if a service also overrides the $TZ variable. Issue #2447. --- nixos/modules/config/timezone.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nixos/modules/config/timezone.nix b/nixos/modules/config/timezone.nix index 88aa7866c2b2..65703d8bb080 100644 --- a/nixos/modules/config/timezone.nix +++ b/nixos/modules/config/timezone.nix @@ -2,6 +2,12 @@ with lib; +let + + tzdir = "${pkgs.tzdata}/share/zoneinfo"; + +in + { options = { @@ -26,8 +32,10 @@ with lib; environment.variables.TZDIR = "/etc/zoneinfo"; + systemd.globalEnvironment.TZDIR = tzdir; + environment.etc.localtime = - { source = "${pkgs.tzdata}/share/zoneinfo/${config.time.timeZone}"; + { source = "${tzdir}/${config.time.timeZone}"; mode = "direct-symlink"; };