nixos/chrony: don't emit initstepslew when servers is empty

Setting the server list to be empty is useful e.g. for hardware-only
or virtualized reference clocks that are passed through to the system
directly. In this case, initstepslew has no effect, so don't emit it.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
Austin Seipp 2018-11-30 18:46:04 -06:00
parent 22926c8b84
commit 7b8d9700e1

View File

@ -12,7 +12,7 @@ let
${concatMapStringsSep "\n" (server: "server " + server) cfg.servers} ${concatMapStringsSep "\n" (server: "server " + server) cfg.servers}
${optionalString ${optionalString
cfg.initstepslew.enabled (cfg.initstepslew.enabled && (cfg.servers != []))
"initstepslew ${toString cfg.initstepslew.threshold} ${concatStringsSep " " cfg.initstepslew.servers}" "initstepslew ${toString cfg.initstepslew.threshold} ${concatStringsSep " " cfg.initstepslew.servers}"
} }