summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorAustin Seipp <aseipp@pobox.com>2018-10-23 15:49:42 -0500
committerAustin Seipp <aseipp@pobox.com>2018-11-02 09:10:15 -0500
commit93aa285376daea647df6d95c50622230d118fd01 (patch)
treebe1bd84215e7d831195f681f7730aae25d92cedf /nixos
parente23ebd02ab2359dbd2d9a86a8822424ce330100d (diff)
downloadnixlib-93aa285376daea647df6d95c50622230d118fd01.tar
nixlib-93aa285376daea647df6d95c50622230d118fd01.tar.gz
nixlib-93aa285376daea647df6d95c50622230d118fd01.tar.bz2
nixlib-93aa285376daea647df6d95c50622230d118fd01.tar.lz
nixlib-93aa285376daea647df6d95c50622230d118fd01.tar.xz
nixlib-93aa285376daea647df6d95c50622230d118fd01.tar.zst
nixlib-93aa285376daea647df6d95c50622230d118fd01.zip
nixos: fix #48917 by setting SYSTEMD_TIMEDATED_NTP_SERVICES
Setting this variable in the environment of systemd-timedated allows
'timedatectl' to tell if an NTP service is running.

Closes #48917.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/chrony.nix2
-rw-r--r--nixos/modules/services/networking/ntpd.nix2
2 files changed, 4 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/chrony.nix b/nixos/modules/services/networking/chrony.nix
index a363b545d649..9b8005e706ae 100644
--- a/nixos/modules/services/networking/chrony.nix
+++ b/nixos/modules/services/networking/chrony.nix
@@ -93,6 +93,8 @@ in
 
     services.timesyncd.enable = mkForce false;
 
+    systemd.services.systemd-timedated.environment = { SYSTEMD_TIMEDATED_NTP_SERVICES = "chronyd.service"; };
+
     systemd.services.chronyd =
       { description = "chrony NTP daemon";
 
diff --git a/nixos/modules/services/networking/ntpd.nix b/nixos/modules/services/networking/ntpd.nix
index 342350d49ab3..32174100b0f7 100644
--- a/nixos/modules/services/networking/ntpd.nix
+++ b/nixos/modules/services/networking/ntpd.nix
@@ -67,6 +67,8 @@ in
     environment.systemPackages = [ pkgs.ntp ];
     services.timesyncd.enable = mkForce false;
 
+    systemd.services.systemd-timedated.environment = { SYSTEMD_TIMEDATED_NTP_SERVICES = "ntpd.service"; };
+
     users.users = singleton
       { name = ntpUser;
         uid = config.ids.uids.ntp;