Skip to content

Commit

Permalink
nixos/timesyncd: add extraConfig option
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
cdepillabout committed Nov 20, 2019
1 parent 4414a3b commit 6c019a8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions nixos/modules/system/boot/timesyncd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
<link xlink:href="https://www.freedesktop.org/software/systemd/man/timesyncd.conf.html">
timesyncd.conf(5)</link> for available options.
'';
};
};
};

Expand All @@ -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;
Expand Down

0 comments on commit 6c019a8

Please sign in to comment.