Fix time syncing

Can't believe I was ~5 seconds off on all my computers for this long x)
This commit is contained in:
Geoffrey Frogeye 2024-12-25 15:22:07 +01:00
parent 0ac79c3d0c
commit 8c45c1989c
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8

View file

@ -53,7 +53,17 @@ in
}) })
]; ];
# wireless support via wpa_supplicant # wireless support via wpa_supplicant
networking.wireless = { networking = {
# Tell the time synchronisation service when we got/lost the connection
dhcpcd.runHook = ''
if $if_up; then
${config.services.chrony.package}/bin/chronyc online
elif $if_down; then
${config.services.chrony.package}/bin/chronyc offline
fi
'';
wireless = {
enable = true; enable = true;
extraConfig = '' extraConfig = ''
country=NL country=NL
@ -70,7 +80,11 @@ in
] (ssid: { }); ] (ssid: { });
userControlled.enable = true; # Allow some control with wpa_cli userControlled.enable = true; # Allow some control with wpa_cli
}; };
};
# Wait until there's a connection to fetch time
services.chrony.serverOption = "offline"; services.chrony.serverOption = "offline";
systemd.services.wifi_apply = { systemd.services.wifi_apply = {
after = [ "wpa_supplicant.service" ]; after = [ "wpa_supplicant.service" ];
wantedBy = [ "wpa_supplicant.service" ]; wantedBy = [ "wpa_supplicant.service" ];