diff options
author | Jörg Thalheim <joerg@higgsboson.tk> | 2016-12-14 23:49:14 +0100 |
---|---|---|
committer | Jörg Thalheim <joerg@higgsboson.tk> | 2016-12-17 00:00:45 +0100 |
commit | 1590461887333e2fda46f4bd74aef3785b253089 (patch) | |
tree | cd5d6652a758dc54bffd73e9d313ba5d1d73abf1 /nixos/modules/services/networking | |
parent | 993cbf8acb9da679bb8bca00eacada6d83ed6994 (diff) | |
download | nixlib-1590461887333e2fda46f4bd74aef3785b253089.tar nixlib-1590461887333e2fda46f4bd74aef3785b253089.tar.gz nixlib-1590461887333e2fda46f4bd74aef3785b253089.tar.bz2 nixlib-1590461887333e2fda46f4bd74aef3785b253089.tar.lz nixlib-1590461887333e2fda46f4bd74aef3785b253089.tar.xz nixlib-1590461887333e2fda46f4bd74aef3785b253089.tar.zst nixlib-1590461887333e2fda46f4bd74aef3785b253089.zip |
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)
Diffstat (limited to 'nixos/modules/services/networking')
-rw-r--r-- | nixos/modules/services/networking/chrony.nix | 4 | ||||
-rw-r--r-- | nixos/modules/services/networking/ntpd.nix | 10 | ||||
-rw-r--r-- | nixos/modules/services/networking/openntpd.nix | 2 |
3 files changed, 6 insertions, 10 deletions
diff --git a/nixos/modules/services/networking/chrony.nix b/nixos/modules/services/networking/chrony.nix index d40865ebbd5b..f2ff11633b1b 100644 --- a/nixos/modules/services/networking/chrony.nix +++ b/nixos/modules/services/networking/chrony.nix @@ -31,7 +31,7 @@ in }; servers = mkOption { - default = config.services.ntp.servers; + default = config.networking.timeServers; description = '' The set of NTP servers from which to synchronise. ''; @@ -102,7 +102,7 @@ in home = stateDir; }; - systemd.services.ntpd.enable = mkForce false; + systemd.services.timesyncd.enable = mkForce false; systemd.services.chronyd = { description = "chrony NTP daemon"; diff --git a/nixos/modules/services/networking/ntpd.nix b/nixos/modules/services/networking/ntpd.nix index c8a085679280..88e6dbf22b9e 100644 --- a/nixos/modules/services/networking/ntpd.nix +++ b/nixos/modules/services/networking/ntpd.nix @@ -34,7 +34,7 @@ in services.ntp = { enable = mkOption { - default = !config.boot.isContainer; + default = false; description = '' Whether to synchronise your machine's time using the NTP protocol. @@ -42,12 +42,7 @@ in }; servers = mkOption { - default = [ - "0.nixos.pool.ntp.org" - "1.nixos.pool.ntp.org" - "2.nixos.pool.ntp.org" - "3.nixos.pool.ntp.org" - ]; + default = config.networking.timeServers; description = '' The set of NTP servers from which to synchronise. ''; @@ -70,6 +65,7 @@ in # Make tools such as ntpq available in the system path. environment.systemPackages = [ pkgs.ntp ]; + services.timesyncd.enable = mkForce false; users.extraUsers = singleton { name = ntpUser; diff --git a/nixos/modules/services/networking/openntpd.nix b/nixos/modules/services/networking/openntpd.nix index a8625fa2fa91..13a1b5258ce0 100644 --- a/nixos/modules/services/networking/openntpd.nix +++ b/nixos/modules/services/networking/openntpd.nix @@ -49,7 +49,7 @@ in ###### implementation config = mkIf cfg.enable { - services.ntp.enable = mkForce false; + services.timesyncd.enable = mkForce false; # Add ntpctl to the environment for status checking environment.systemPackages = [ package ]; |