1 { config, lib, pkgs, ... }:
3 inherit (pkgs) htpdate;
5 cfg = config.services.htpdate;
16 enable = lib.mkOption {
17 type = lib.types.bool;
20 Enable htpdate daemon.
24 extraOptions = lib.mkOption {
28 Additional command line arguments to pass to htpdate.
32 servers = lib.mkOption {
33 type = lib.types.listOf lib.types.str;
34 default = [ "www.google.com" ];
36 HTTP servers to use for time synchronization.
40 proxy = lib.mkOption {
43 example = "127.0.0.1:8118";
45 HTTP proxy used for requests.
55 config = lib.mkIf cfg.enable {
57 systemd.services.htpdate = {
58 description = "htpdate daemon";
59 wantedBy = [ "multi-user.target" ];
62 PIDFile = "/run/htpdate.pid";
63 ExecStart = lib.concatStringsSep " " [
64 "${htpdate}/bin/htpdate"
68 "${lib.optionalString (cfg.proxy != "") "-P ${cfg.proxy}"}"
70 "${lib.concatStringsSep " " cfg.servers}"