From b0c5452e3bb1e3bdbb27181e331fc959fa43f4fc Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Thu, 24 Sep 2026 15:28:24 +0000 Subject: Detect NixOS host timezone automatically instead of defaulting to UTC Enables services.automatic-timezoned so every host's clock/calendar reflects its actual location with no manual timedatectl step or auth prompt, since GNOME's own automatic-timezone toggle isn't wired to a passwordless polkit rule on NixOS the way KDE's is. Co-Authored-By: Claude Sonnet 5 --- modules/nixos/common.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'modules/nixos/common.nix') diff --git a/modules/nixos/common.nix b/modules/nixos/common.nix index 9ee164b..919e2f0 100644 --- a/modules/nixos/common.nix +++ b/modules/nixos/common.nix @@ -12,10 +12,19 @@ }; # Per-host configuration.nix can override either of these without - # conflicting, since they're set with mkDefault here. + # conflicting, since they're set with mkDefault here. automatic-timezoned + # (below) overrides time.timeZone to null at normal priority once enabled; + # Etc/UTC only remains as the boot-time value until it detects and applies + # the real one. time.timeZone = lib.mkDefault "Etc/UTC"; i18n.defaultLocale = lib.mkDefault "en_US.UTF-8"; + # Keeps the system timezone in sync with actual location with no manual + # timedatectl step and no interactive auth prompt (unlike GNOME's own + # "Automatic Time Zone" toggle, which nixpkgs' GNOME module doesn't wire up + # to a passwordless polkit rule the way it does for KDE Plasma). + services.automatic-timezoned.enable = true; + users.users.tom = { isNormalUser = true; extraGroups = [ -- cgit v1.3