1 { config, lib, pkgs, ... }:
6 cfg = config.services.tzupdate;
8 options.services.tzupdate = {
13 Enable the tzupdate timezone updating service. This provides
14 a one-shot service which can be activated with systemctl to
20 config = mkIf cfg.enable {
21 # We need to have imperative time zone management for this to work.
22 # This will give users an error if they have set an explicit time
23 # zone, which is better than silently overriding it.
26 # We provide a one-shot service which can be manually run. We could
27 # provide a service that runs on startup, but it's tricky to get
28 # a service to run after you have *internet* access.
29 systemd.services.tzupdate = {
30 description = "tzupdate timezone update service";
31 wants = [ "network-online.target" ];
32 after = [ "network-online.target" ];
34 timedatectl set-timezone $(${lib.getExe pkgs.tzupdate} --print-only)
43 meta.maintainers = with lib.maintainers; [ doronbehar ];