diff --git a/nixos/modules/services/misc/tzupdate.nix b/nixos/modules/services/misc/tzupdate.nix index be63bb179e42..9e979bb47675 100644 --- a/nixos/modules/services/misc/tzupdate.nix +++ b/nixos/modules/services/misc/tzupdate.nix @@ -30,16 +30,15 @@ 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"; }; }; }; - meta.maintainers = [ ]; + meta.maintainers = with lib.maintainers; [ doronbehar ]; } diff --git a/pkgs/applications/misc/tzupdate/default.nix b/pkgs/applications/misc/tzupdate/default.nix index c991a71e9c0a..adfb93fb0246 100644 --- a/pkgs/applications/misc/tzupdate/default.nix +++ b/pkgs/applications/misc/tzupdate/default.nix @@ -11,18 +11,21 @@ rustPlatform.buildRustPackage rec { src = fetchFromGitHub { owner = "cdown"; repo = "tzupdate"; - rev = version; + rev = "refs/tags/${version}"; hash = "sha256-eod4yFzX7pATNQmG7jU+r9mnC9nprJ55ufMXpKjw/YI="; }; cargoHash = "sha256-5+lp5xlwJxFDqzVxptJPX7z0iLoMkgdwHxvRVIXHF7Y="; - meta = with lib; { + meta = { description = "Set the system timezone based on IP geolocation"; homepage = "https://github.com/cdown/tzupdate"; - license = licenses.mit; - maintainers = with maintainers; [ camillemndn ]; - platforms = platforms.linux; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ + camillemndn + doronbehar + ]; + platforms = lib.platforms.linux; mainProgram = "tzupdate"; }; }