A Linux daemon to automatically update the system timezone based on location.
zone1970.tab
filesystemd-timedated
Note: The timezone choice may not be accurate if a reference city in a neighboring timezone is closer than any one in the actual timezone.
tzdata
a.k.a. zoneinfo
org.freedesktop.timedate1.set-timezone
action (root
or Polkit rule)whitelist
(see also Stebalien/localtime - Configuring GeoClue, geoclue/geoclue#74)Please see the examples/ directory for sample configurations.
Sample Nix modules can be found here (may be submitted to NixOS/nixpkgs if there is interest):
``` $ automatic-timezoned --help automatic-timezoned [VERSION] Automatically update system timezone based on location
USAGE: automatic-timezoned [OPTIONS]
OPTIONS: -h, --help Print help information
-l, --log-level <LOG_LEVEL>
Log level filter. See <https://docs.rs/env_logger> for syntax [env: AUTOTZD_LOG_LEVEL=]
[default: info]
-V, --version
Print version information
-z, --zoneinfo-path <ZONEINFO_PATH>
Path to zoneinfo tab file [env: AUTOTZD_ZONEINFO_FILE=] [default:
/usr/share/zoneinfo/zone1970.tab]
```
shell
cargo build --release
shell
cargo test
This service depends on the tzdata
package which allows to update the Time Zone Database independently and does not depend on a third-party service to calculate distances,
here are some alternatives which have made different trade-offs for performance and accuracy:
tzdata
package and Nominatim Web API for distances.GNU General Public License v3.0