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; }; 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