nixos/tzupdate: use timedatectl to actually set the timezone

See also: https://github.com/cdown/tzupdate/issues/135
This commit is contained in:
Doron Behar 2024-09-17 09:30:55 +03:00
parent 94892f8f20
commit 8efaf0d2d6

View File

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