From e98fd6765397444feea0fa4d16ae22cd2a3c0b26 Mon Sep 17 00:00:00 2001 From: Padreug Date: Thu, 24 Sep 2026 12:26:39 +0200 Subject: [PATCH] feat(deploy): set the timezone per machine, sintra to Europe/Paris Every machine inherited America/Guatemala from the shared base config, which is right for douro and tejo and wrong for sintra in France. It read six hours behind, so its journal timestamps had to be converted by hand against anything on the relay. The clock is not cosmetic here. system.autoUpgrade's `dates = "04:00"` is local time, so the zone decides when the nightly rebuild restarts the app and the Fujitsu dispenser runs its audible init routine. On sintra that was firing at 10:17 in the morning, in the room, rather than at 4am. timeZoneForModel mirrors fiatCodeForModel and lists only the exceptions. The base config keeps America/Guatemala as the fleet default, now under mkDefault so a per-model value wins without mkForce. Verified by eval: sintra resolves to Europe/Paris, douro, tejo and batm3 are unchanged. batm3 is deliberately left alone. It is USD and in the field, and I do not know where. --- deploy/nixos/configuration.nix | 5 +++-- flake.nix | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/deploy/nixos/configuration.nix b/deploy/nixos/configuration.nix index 6c11db7..3d62d54 100644 --- a/deploy/nixos/configuration.nix +++ b/deploy/nixos/configuration.nix @@ -46,8 +46,9 @@ }; }; - # Timezone - set to your location - time.timeZone = "America/Guatemala"; + # Fleet default. Override per machine with timeZoneForModel in flake.nix — + # mkDefault is what lets that override win without mkForce. + time.timeZone = lib.mkDefault "America/Guatemala"; # Locale i18n.defaultLocale = "en_US.UTF-8"; diff --git a/flake.nix b/flake.nix index 194ca55..73b6b2f 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,18 @@ batm3 = "USD"; }; + # Timezone per machine model. Wall-clock time on an ATM is not cosmetic: + # it is what the journal is read in when someone is standing at the + # machine, and system.autoUpgrade's `dates = "04:00"` is local, so this + # decides when the nightly rebuild restarts the app and the dispenser + # runs its audible init routine. A machine on the wrong zone does that + # in the middle of its own business hours. + # + # Unlisted models fall back to the fleet default in configuration.nix. + timeZoneForModel = { + sintra = "Europe/Paris"; + }; + lib = nixpkgs.lib; # Helper to create a live USB NixOS config for a specific machine model @@ -124,6 +136,10 @@ appDir = "${atm-app}"; }; + # Per-machine wall clock; see timeZoneForModel above. + time.timeZone = lib.mkIf (timeZoneForModel ? ${machineModel}) + timeZoneForModel.${machineModel}; + # Operator TUI and CLI tools environment.systemPackages = [ atm-tui.packages.${system}.default -- 2.55.0