From 45c0d047355a8b847fb1606072c6a60b2887116d Mon Sep 17 00:00:00 2001 From: datafoo <34766150+datafoo@users.noreply.github.com> Date: Mon, 19 Aug 2024 09:26:12 +0200 Subject: [PATCH] nixos/timesyncd: minor refactoring --- nixos/modules/system/boot/timesyncd.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nixos/modules/system/boot/timesyncd.nix b/nixos/modules/system/boot/timesyncd.nix index f93064569bf6..82e3b8c15759 100644 --- a/nixos/modules/system/boot/timesyncd.nix +++ b/nixos/modules/system/boot/timesyncd.nix @@ -2,6 +2,9 @@ with lib; +let + cfg = config.services.timesyncd; +in { options = { @@ -41,7 +44,7 @@ with lib; }; }; - config = mkIf config.services.timesyncd.enable { + config = mkIf cfg.enable { systemd.additionalUpstreamSystemUnits = [ "systemd-timesyncd.service" ]; @@ -82,8 +85,8 @@ with lib; environment.etc."systemd/timesyncd.conf".text = '' [Time] - NTP=${concatStringsSep " " config.services.timesyncd.servers} - ${config.services.timesyncd.extraConfig} + NTP=${concatStringsSep " " cfg.servers} + ${cfg.extraConfig} ''; users.users.systemd-timesync = {