diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index a2fd124765cd..2f89c8a42e50 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -448,6 +448,10 @@ - The hooks `yarnConfigHook` and `yarnBuildHook` were added. These should replace `yarn2nix.mkYarnPackage` and other `yarn2nix` related tools. The motivation to get rid of `yarn2nix` tools is the fact that they are too complex and hard to maintain, and they rely upon too much Nix evaluation which is problematic if import-from-derivation is not allowed (see more details at [#296856](https://github.com/NixOS/nixpkgs/issues/296856). The transition from `mkYarnPackage` to `yarn{Config,Build}Hook` is tracked at [#324246](https://github.com/NixOS/nixpkgs/issues/324246). +- `services.timesyncd.servers` now defaults to `null`, allowing systemd-timesyncd to use NTP servers advertised by DHCP. + +- `services.timesyncd.fallbackServers` was added and defaults to `networking.timeServers`. + - Cinnamon has been updated to 6.2, please check [upstream announcement](https://www.linuxmint.com/rel_wilma_whatsnew.php) for more details. Following Mint 22 defaults, the Cinnamon module no longer ships geary and hexchat by default. diff --git a/nixos/modules/system/boot/timesyncd.nix b/nixos/modules/system/boot/timesyncd.nix index d54ed687c8e7..117ced1f59dd 100644 --- a/nixos/modules/system/boot/timesyncd.nix +++ b/nixos/modules/system/boot/timesyncd.nix @@ -19,8 +19,7 @@ in ''; }; servers = mkOption { - default = config.networking.timeServers; - defaultText = literalExpression "config.networking.timeServers"; + default = null; type = nullOr (listOf str); description = '' The set of NTP servers from which to synchronise. @@ -32,6 +31,20 @@ in See man:timesyncd.conf(5) for details. ''; }; + fallbackServers = mkOption { + default = config.networking.timeServers; + defaultText = literalExpression "config.networking.timeServers"; + type = nullOr (listOf str); + description = '' + The set of fallback NTP servers from which to synchronise. + + Setting this option to an empty list will write `FallbackNTP=` to the + `timesyncd.conf` file as opposed to setting this option to null which + will remove `FallbackNTP=` entirely. + + See man:timesyncd.conf(5) for details. + ''; + }; extraConfig = mkOption { default = ""; type = lines; @@ -92,6 +105,9 @@ in + optionalString (cfg.servers != null) '' NTP=${concatStringsSep " " cfg.servers} '' + + optionalString (cfg.fallbackServers != null) '' + FallbackNTP=${concatStringsSep " " cfg.fallbackServers} + '' + cfg.extraConfig; users.users.systemd-timesync = {