diff --git a/nixos/modules/services/misc/tzupdate.nix b/nixos/modules/services/misc/tzupdate.nix index 188ef95e185d..85b1b3647ef7 100644 --- a/nixos/modules/services/misc/tzupdate.nix +++ b/nixos/modules/services/misc/tzupdate.nix @@ -28,7 +28,11 @@ in { wants = [ "network-online.target" ]; after = [ "network-online.target" ]; script = '' - timedatectl set-timezone "$(${lib.getExe pkgs.tzupdate} --print-only)" + timezone="$(${lib.getExe pkgs.tzupdate} --print-only)" + if [[ -n "$timezone" ]]; then + echo "Setting timezone to '$timezone'" + timedatectl set-timezone "$timezone" + fi ''; serviceConfig = {