Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-07-31 10:13:36 +01:00
parent bfc856366f
commit 386acab024
4 changed files with 27 additions and 2 deletions

View File

@@ -0,0 +1,4 @@
{ ... }:
{
services.ntp.enable = true;
}

View File

@@ -0,0 +1,14 @@
{ lib, pkgs, ... }:
{
networking.networkmanager.dispatcherScripts = [
{
source = lib.meta.getExe (
pkgs.writeShellApplication {
name = "timezone-sync";
runtimeInputs = with pkgs; [ curl ];
text = builtins.readFile ./timezone.sh;
}
);
}
];
}

View File

@@ -0,0 +1,7 @@
case "$2" in
connectivity-change)
if timezone=$(curl --fail https://ipapi.co/timezone); then
timedatectl set-timezone "$timezone"
fi
;;
esac