ntp: make timesyncd the new default

- most nixos user only require time synchronisation,
  while ntpd implements a battery-included ntp server (1,215 LOCs of C-Code vs 64,302)
- timesyncd support ntp server per interface (if configured through dhcp for instance)
- timesyncd is already included in the systemd package, switching to it would
  save a little disk space (1,5M)
This commit is contained in:
Jörg Thalheim
2016-12-17 00:00:45 +01:00
parent 993cbf8acb
commit 1590461887
10 changed files with 36 additions and 26 deletions
-3
View File
@@ -687,8 +687,5 @@ in
};
services.resolved.enable = mkDefault true;
services.timesyncd.enable = mkDefault config.services.ntp.enable;
};
}
+14 -9
View File
@@ -6,14 +6,21 @@ with lib;
options = {
services.timesyncd.enable = mkOption {
default = false;
type = types.bool;
description = ''
Enables the systemd NTP client daemon.
'';
services.timesyncd = {
enable = mkOption {
default = !config.boot.isContainer;
type = types.bool;
description = ''
Enables the systemd NTP client daemon.
'';
};
servers = mkOption {
default = config.networking.timeServers;
description = ''
The set of NTP servers from which to synchronise.
'';
};
};
};
config = mkIf config.services.timesyncd.enable {
@@ -30,8 +37,6 @@ with lib;
NTP=${concatStringsSep " " config.services.ntp.servers}
'';
systemd.services.ntpd.enable = false;
users.extraUsers.systemd-timesync.uid = config.ids.uids.systemd-timesync;
users.extraGroups.systemd-timesync.gid = config.ids.gids.systemd-timesync;