1 { config, lib, pkgs, ... }:
6 inherit (pkgs) htpdate;
8 cfg = config.services.htpdate;
22 description = lib.mdDoc ''
23 Enable htpdate daemon.
27 extraOptions = mkOption {
30 description = lib.mdDoc ''
31 Additional command line arguments to pass to htpdate.
36 type = types.listOf types.str;
37 default = [ "www.google.com" ];
38 description = lib.mdDoc ''
39 HTTP servers to use for time synchronization.
46 example = "127.0.0.1:8118";
47 description = lib.mdDoc ''
48 HTTP proxy used for requests.
58 config = mkIf cfg.enable {
60 systemd.services.htpdate = {
61 description = "htpdate daemon";
62 wantedBy = [ "multi-user.target" ];
65 PIDFile = "/run/htpdate.pid";
66 ExecStart = concatStringsSep " " [
67 "${htpdate}/bin/htpdate"
71 "${optionalString (cfg.proxy != "") "-P ${cfg.proxy}"}"
73 "${concatStringsSep " " cfg.servers}"