nixos/tzupdate: make it actually work (#343748)

This commit is contained in:
Doron Behar
2024-09-29 12:56:06 +03:00
committed by GitHub
2 changed files with 12 additions and 10 deletions
+4 -5
View File
@@ -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 ];
}
+8 -5
View File
@@ -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";
};
}