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" ];
36 # We could link directly into pkgs.tzdata, but at least timedatectl seems
37 # to expect the symlink to point directly to a file in etc.
38 # Setting the "debian timezone file" to point at /dev/null stops it doing anything.
39 ExecStart = "${pkgs.tzupdate}/bin/tzupdate -z /etc/zoneinfo -d /dev/null";
44 meta.maintainers = [ ];