diff --git a/os/time/default.nix b/os/time/default.nix index c61be7a..4f8b749 100644 --- a/os/time/default.nix +++ b/os/time/default.nix @@ -1,6 +1,5 @@ { lib, - config, ... }: { @@ -9,39 +8,8 @@ services.chrony.enable = true; networking = { - # Using community provided service + # Using european servers timeServers = map (n: "${toString n}.europe.pool.ntp.org") (lib.lists.range 0 3); - - # Only try to sync time when we have internet connection - dhcpcd.runHook = '' - if $if_up - then - /run/wrappers/bin/sudo ${config.services.chrony.package}/bin/chronyc online - elif $if_down - then - /run/wrappers/bin/sudo ${config.services.chrony.package}/bin/chronyc offline - fi - ''; }; - - # Allow dhcpcd to control chrony - security.sudo.extraRules = [ - { - users = [ "dhcpcd" ]; - commands = - builtins.map - (arg: { - command = "${config.services.chrony.package}/bin/chronyc ${arg}"; - options = [ "NOPASSWD" ]; - - }) - [ - "online" - "offline" - ]; - } - ]; - systemd.services.dhcpcd.serviceConfig.NoNewPrivileges = false; - }; } diff --git a/os/wireless/default.nix b/os/wireless/default.nix index 82f1d52..758c29b 100644 --- a/os/wireless/default.nix +++ b/os/wireless/default.nix @@ -90,9 +90,6 @@ in }; }; - # Wait until there's a connection to fetch time - services.chrony.serverOption = "offline"; - systemd.services.wifi_apply = { after = [ "wpa_supplicant.service" ]; wantedBy = [ "wpa_supplicant.service" ];