From 8efaf0d2d6ae01cdafe9de714ab803d9eaec2aca Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 17 Sep 2024 09:30:55 +0300 Subject: [PATCH] nixos/tzupdate: use timedatectl to actually set the timezone See also: https://github.com/cdown/tzupdate/issues/135 --- nixos/modules/services/misc/tzupdate.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/misc/tzupdate.nix b/nixos/modules/services/misc/tzupdate.nix index e9f086a2ad78..9e979bb47675 100644 --- a/nixos/modules/services/misc/tzupdate.nix +++ b/nixos/modules/services/misc/tzupdate.nix @@ -30,13 +30,12 @@ in { description = "tzupdate timezone update service"; wants = [ "network-online.target" ]; after = [ "network-online.target" ]; + script = '' + timedatectl set-timezone $(${lib.getExe pkgs.tzupdate} --print-only) + ''; serviceConfig = { Type = "oneshot"; - # We could link directly into pkgs.tzdata, but at least timedatectl seems - # to expect the symlink to point directly to a file in etc. - # Setting the "debian timezone file" to point at /dev/null stops it doing anything. - ExecStart = "${pkgs.tzupdate}/bin/tzupdate -z /etc/zoneinfo -d /dev/null"; }; }; };