Skip to content

Comments

feature(timezone/locale): enable runtime adjustment, move to features#1772

Open
kajusnau wants to merge 3 commits intotiiuae:mainfrom
kajusnau:tz-locale-etc
Open

feature(timezone/locale): enable runtime adjustment, move to features#1772
kajusnau wants to merge 3 commits intotiiuae:mainfrom
kajusnau:tz-locale-etc

Conversation

@kajusnau
Copy link
Collaborator

@kajusnau kajusnau commented Feb 20, 2026

Description of Changes

Quick summary:

Timezone and locale settings moved to features
Timezone and locale can now be adjusted at runtime via COSMIC tools or any other tools.
Changes take effect immediately (timezone), after session restart (locale session config), or after system reboot (if system locale override is enabled).

Detailed changes:

  1. Timezone and locale module changes:
    • Timezone (ghaf.services.timezone):
      • Timezone changes are now monitored via systemd instead of a long-running dbus monitor
      • Added explicit timezone.propagate option to control propagation via givc
      • Changed the behavior of timezone.enable to instead control runtime mgmt of timezone on the target system
      • Enabling timezone.propagate now sets time.timeZone to null, which enables runtime mgmt
    • Locale(ghaf.services.locale):
      • Added explicit locale.propagate option to control propagation via givc
      • Changed the behavior of locale.enable to instead control runtime mgmt of locale on the target system
      • Implemented system locale overriding (shell, greeter, etc.) via locale.overrideSystemLocale (naming suggestions welcome).
      • Added persistent locale settings storage at /var/lib/locale/.locale-env, which will be imported by the global .profile at boot if locale.overrideSystemLocale == true.
      • Renamed locale handler services to better reflect their responsibilities
  2. Moved timezone and locale modules under features umbrella:
    • Can now be enabled on any VM via global config features
    • Timezone module (runtime mgmt) enabled on all sysvms by default
    • Locale module enabled on gui-vm by default
    • Locale and timezone propagation, and system locale overriding enabled only on gui-vm by default
    • Changed global config time.timeZone to null by default
  3. Fixed ghaf-intro not starting automatically:
    • Was caused by incorrect desktop entry naming
    • Changed to be launched via ghaf-open, which will determine the correct desktop entry automatically

Type of Change

  • New Feature
  • Bug Fix
  • Improvement / Refactor

Related Issues / Tickets

Closes/fixes:

Checklist

  • Clear summary in PR description
  • Detailed and meaningful commit message(s)
  • Commits are logically organized and squashed if appropriate
  • Contribution guidelines followed
  • Ghaf documentation updated with the commit - https://tiiuae.github.io/ghaf/
  • Author has run make-checks and it passes
  • All automatic GitHub Action checks pass - see actions
  • Author has added reviewers and removed PR draft status

Testing Instructions

Applicable Targets

  • Orin AGX aarch64
  • Orin NX aarch64
  • Lenovo X1 x86_64
  • Dell Latitude x86_64
  • System 76 x86_64

Installation Method

  • Requires full re-installation
  • Can be updated with nixos-rebuild ... switch
  • Other:

Test Steps To Verify:

Note

Fresh install is recommended for testing

Warning

Changing the locale (language) might result in localization occuring in the shell - e.g. some common shell utilities might have their output automatically translated to your selected language.

  1. Boot into Ghaf and begin the COSMIC initial setup flow
  2. Verify timezone and locale (language) pages show up in the initial setup
  3. Choose some custom timezone and locale and proceed until initial setup is finished
  4. Verify ghaf-intro opens automatically
  5. Verify gui-vm and other sysvms timezones are set to whatever you chose in initial setup
  6. Restart the session or reboot to verify locale changes have taken effect as well:
    • The login screen should display the date and time in the appropriate locale format (e.g. Finnish if Finnish locale was selected)
    • The DE apps and tools should show some signs of translation and time formatting based on the locale as well
  7. Verify locale and timezone can be adjusted freely within COSMIC Settings app, with changes taking effect:
    • Timezone changes take effect immediately
    • Locale changes take effect on session restart or reboot

Signed-off-by: Kajus Naujokaitis <kajus.naujokaitis@unikie.com>
@kajusnau kajusnau changed the title Tz locale etc feature(timezone/locale): enable runtime adjustment, move to features Feb 23, 2026
@kajusnau kajusnau marked this pull request as ready for review February 23, 2026 10:00
@kajusnau kajusnau self-assigned this Feb 23, 2026
@kajusnau kajusnau added the Needs Testing CI Team to pre-verify label Feb 23, 2026
ghaf.storagevm.directories = [
{
directory = dirOf globalConfPath;
mode = "0755";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats happening here?

Copy link
Collaborator Author

@kajusnau kajusnau Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Persistent storage of locale env settings at /var/lib/locale, with read rights for users so both user session and system services can monitor changes.

@Gaya-03
Copy link
Collaborator

Gaya-03 commented Feb 24, 2026

Tested on system76 and Lenovo-X1

  • Timezone and locale pages appear in the intial setup
  • The ghaf-intro page opens up within 5 secs after the initial setup flow is completed
  • The timezone and locale setup in the inital setup flow is reflected
  • The changed timezone can be seen reflected in all vms when checked using timedatectl -a
  • The timezone changes from the COSMIC settings are applied correctly

Issues identified:

  1. The 'Date, Time and Calendar settings' from launched from the taskbar , takes 10 + secs to launch after clicking
  2. The Preferred language changes from the COSMIC settings after the initial setup is not working . The previous language setup during the initial setup flow remains . The changes do not take effect after a reboot. ( seen only with System 76)
  3. Some languages eg: Hindi when selected changes the whole language inside the COSMIC settings , COSMIC files while another language like Finnish does not change the language inside the COSMIC settings , COSMIC files .
  4. even after changing the region formatting, the date formats are not changed correctly
    Screenshots and logs shared with @kajusnau directly

@Gaya-03 Gaya-03 added bug on Lenovo X1 Carbon Issues found on Lenovo X1 Carbon while checking this PR Bug on System76 and removed Needs Testing CI Team to pre-verify labels Feb 24, 2026
Comment on lines +396 to +400
targetVms = [
"gui-vm"
"net-vm"
"admin-vm"
"audio-vm"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also need to configure the timezone for the app VMs?

Copy link
Collaborator Author

@kajusnau kajusnau Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this patch App VMs will inherit the globalConfig value of time.timeZone via modules/microvm/sysvms/appvm-base.nix #296, which will default to null. This enables runtime management of the timezone.

As for enabling explicitly via targetVms, I'm not sure how we'd go about it with the current implementation.
App VMs are instantiated multiple times, so we'd need to list each VM here, e.g. "chromium-vm", "comms-vm", or have some way to enable it globally for all App VMs with some targetVms = [ ... "app-vm" ... ]
Any ideas about this from @brianmcgillion ?

Maybe this could be tackled in a separate PR if/when needed?

- implemented runtime mgmt of timezone and locale
- enablind these modules now enables runtime mgmt of both
- simplified tz forwarding to be triggered by systemd
- added persistent locale settings storage
- added .profile locale inheritance on boot
- added system-wide .profile locale inheritance on boot
- added explicit systemd services to handle locale mgmt and forwarding
- enabled timezone and locale pages in initial setup

Signed-off-by: Kajus Naujokaitis <kajus.naujokaitis@unikie.com>
- exposed timezone and locale modules as features in global config
- enabled timezone and locale features in sysvms
- enabled timezone and locale propagation in gui-vm
- enabled system locale override in gui-vm
- set default time.timeZone to null in global config

Signed-off-by: Kajus Naujokaitis <kajus.naujokaitis@unikie.com>
@kajusnau
Copy link
Collaborator Author

Issues identified:

  1. The 'Date, Time and Calendar settings' from launched from the taskbar , takes 10 + secs to launch after clicking
  2. The Preferred language changes from the COSMIC settings after the initial setup is not working . The previous language setup during the initial setup flow remains . The changes do not take effect after a reboot. ( seen only with System 76)
  3. Some languages eg: Hindi when selected changes the whole language inside the COSMIC settings , COSMIC files while another language like Finnish does not change the language inside the COSMIC settings , COSMIC files .
  4. even after changing the region formatting, the date formats are not changed correctly
    Screenshots and logs shared with @kajusnau directly

Thanks for testing!

Issues 1 and 3 are valid, but unrelated to this PR:
1 - storeDisk images are much faster, this is unrelated to the changes made in this PR
3 - Translations are a work-in-progress by the open source community at https://hosted.weblate.org/projects/pop-os/. The DE will be updated with new translations with each release and bump on our side.

Updated to fix 2 and 4:

  • Adjusted the timing of the monitoring service to start only after user login to avoid race conditions
  • Added an explicit restore task that runs upon user login to restore previous locale settings
  • Expanded the list of applicable user session locale env vars on any locale change event to be in-line with the global handler (confusing, I know, but it's now easier to maintain)

Please re-test when possible 🫡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug on Lenovo X1 Carbon Issues found on Lenovo X1 Carbon while checking this PR Bug on System76

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants