From 0762396d68a21f82eed7044f361764b573c7f3e0 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Tue, 11 Oct 2016 14:49:38 +0300 Subject: [PATCH 1/2] timezone service: link localtime to /etc/zoneinfo instead of tzinfo directly This is needed so systemd can extract timezone from a symlink. --- nixos/modules/config/timezone.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nixos/modules/config/timezone.nix b/nixos/modules/config/timezone.nix index b9844b4adade..39a45042c6cc 100644 --- a/nixos/modules/config/timezone.nix +++ b/nixos/modules/config/timezone.nix @@ -37,14 +37,15 @@ in environment.sessionVariables.TZDIR = "/etc/zoneinfo"; + # This way services are restarted when tzdata changes. systemd.globalEnvironment.TZDIR = tzdir; environment.etc.localtime = - { source = "${tzdir}/${config.time.timeZone}"; + { source = "/etc/zoneinfo/${config.time.timeZone}"; mode = "direct-symlink"; }; - environment.etc.zoneinfo.source = "${pkgs.tzdata}/share/zoneinfo"; + environment.etc.zoneinfo.source = tzdir; }; From 7a73ecc18e7a79a0088b7b761f48d0400ce0cff3 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Tue, 11 Oct 2016 14:51:15 +0300 Subject: [PATCH 2/2] buildFHSEnv: link /etc/zoneinfo This is needed because now /etc/localtime symlink points there. --- pkgs/build-support/build-fhs-userenv/env.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/build-support/build-fhs-userenv/env.nix b/pkgs/build-support/build-fhs-userenv/env.nix index 1dc71987f543..8bc34d672c96 100644 --- a/pkgs/build-support/build-fhs-userenv/env.nix +++ b/pkgs/build-support/build-fhs-userenv/env.nix @@ -89,6 +89,7 @@ let # symlink other core stuff ln -s /host/etc/localtime localtime + ln -s /host/etc/zoneinfo zoneinfo ln -s /host/etc/machine-id machine-id ln -s /host/etc/os-release os-release