From 6c019a867c330f9ffc6049f8ddb35fe778046929 Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Wed, 20 Nov 2019 14:57:02 +0900 Subject: [PATCH] nixos/timesyncd: add extraConfig option This adds an `extraConfig` option to timesyncd for setting additional options in `/etc/systemd/timesyncd.conf`. This is similar to things like `services.journald.extraConfig` and `services.logind.extraConfig`. --- nixos/modules/system/boot/timesyncd.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nixos/modules/system/boot/timesyncd.nix b/nixos/modules/system/boot/timesyncd.nix index 8282cdd6f3aadf..0b1d0ff6c22b82 100644 --- a/nixos/modules/system/boot/timesyncd.nix +++ b/nixos/modules/system/boot/timesyncd.nix @@ -20,6 +20,18 @@ with lib; The set of NTP servers from which to synchronise. ''; }; + extraConfig = mkOption { + default = ""; + type = types.lines; + example = '' + PollIntervalMaxSec=180 + ''; + description = '' + Extra config options for systemd-timesyncd. See + + timesyncd.conf(5) for available options. + ''; + }; }; }; @@ -35,6 +47,7 @@ with lib; environment.etc."systemd/timesyncd.conf".text = '' [Time] NTP=${concatStringsSep " " config.services.timesyncd.servers} + ${config.services.timesyncd.extraConfig} ''; users.users.systemd-timesync.uid = config.ids.uids.systemd-timesync;