8 inherit (pkgs) htpdate;
10 cfg = config.services.htpdate;
21 enable = lib.mkOption {
22 type = lib.types.bool;
25 Enable htpdate daemon.
29 extraOptions = lib.mkOption {
33 Additional command line arguments to pass to htpdate.
37 servers = lib.mkOption {
38 type = lib.types.listOf lib.types.str;
39 default = [ "www.google.com" ];
41 HTTP servers to use for time synchronization.
45 proxy = lib.mkOption {
48 example = "127.0.0.1:8118";
50 HTTP proxy used for requests.
60 config = lib.mkIf cfg.enable {
62 systemd.services.htpdate = {
63 description = "htpdate daemon";
64 wantedBy = [ "multi-user.target" ];
67 PIDFile = "/run/htpdate.pid";
68 ExecStart = lib.concatStringsSep " " [
69 "${htpdate}/bin/htpdate"
73 "${lib.optionalString (cfg.proxy != "") "-P ${cfg.proxy}"}"
75 "${lib.concatStringsSep " " cfg.servers}"