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

View File

@@ -16,12 +16,14 @@
../common/system/configs/nix
../common/system/configs/nix-ld
../common/system/configs/nixpkgs
../common/system/configs/ntp
../common/system/configs/pipewire
../common/system/configs/plymouth
../common/system/configs/ranger
../common/system/configs/sops
../common/system/configs/ssh
../common/system/configs/system
../common/system/configs/timezone
../common/system/configs/tmux
../common/system/configs/tree
../common/system/configs/users
@@ -32,7 +34,5 @@
];
i18n.defaultLocale = "en_US.UTF-8";
time.timeZone = "Europe/London";
sops.defaultSopsFile = ./secrets/secrets.yaml;
}