From 7d531bc8655aa1466f33f611022cd8de862a41f5 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 12 Oct 2025 12:35:04 +0200 Subject: [PATCH] nixos/ntpd: automagically use pool instead of server The same heuristic has been used for ntpd-rs --- nixos/modules/services/networking/ntp/ntpd.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/ntp/ntpd.nix b/nixos/modules/services/networking/ntp/ntpd.nix index 071512056bf6..71c98e4cecf9 100644 --- a/nixos/modules/services/networking/ntp/ntpd.nix +++ b/nixos/modules/services/networking/ntp/ntpd.nix @@ -23,7 +23,11 @@ let restrict 127.0.0.1 restrict -6 ::1 - ${toString (map (server: "server " + server + " iburst\n") cfg.servers)} + ${toString ( + map ( + server: "${if lib.strings.hasInfix "pool" server then "pool" else "server"} " + server + " iburst\n" + ) cfg.servers + )} ${cfg.extraConfig} '';