Config Language for SDDM Without Modifying defaultLocale

Hello everyone! I’m currently configuring language-related settings. Due to Linux Kernel’s poor support for CJK fonts, I previously set the global language to en_GB.UTF-8 (GB for metric system), and then set the desktop environment language to zh_CN.UTF-8. For SDDM, my previous approach on other distributions was to modify the service file to add relevant variables; however, on NixOS, this seems ineffective. Following my usual practice, I made the following configuration:

systemd.services.display-manager.environment = {
  LANG = "zh_CN.UTF-8";
  LC_ALL = "zh_CN.UTF-8"; # I only set this variable because setting LANG alone didn't work before
};

Unfortunately, this didn’t make SDDM change its language. So I investigated the environment variables of SDDM-related processes and found:

  • The main sddm process inherits environment variables correctly from the Display Manager environment, i.e., LANG=zh_CN.UTF-8, etc.
  • The sddm-helper process has environment variables set to LANG=en_GB.UTF-8

I can’t think of other ways to proceed without modifying defaultLocale. Does anyone have any other suggestions? Thanks.

1 Like