From 2e994e636e14e09e089c4d2c29d2791b26952256 Mon Sep 17 00:00:00 2001 From: Dmitriy Kholkin Date: Wed, 26 Jun 2024 12:34:52 +0300 Subject: [PATCH] fix locale --- machines/NixOS-VPS/default.nix | 17 ++++++++-------- profiles/workspace/locale.nix | 36 +++++++++++++++++++++------------- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/machines/NixOS-VPS/default.nix b/machines/NixOS-VPS/default.nix index 066a2e2..debb97a 100644 --- a/machines/NixOS-VPS/default.nix +++ b/machines/NixOS-VPS/default.nix @@ -141,27 +141,28 @@ ]; # Locale - i18n.defaultLocale = "en_US.UTF-8"; + i18n.defaultLocale = "en_IE.UTF-8"; i18n.extraLocaleSettings = { - LANGUAGE = "en_US.UTF-8"; - LC_ALL = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; + LANGUAGE = "en_IE:en:C:ru_RU"; + LC_TIME = "en_DK.UTF-8"; LC_ADDRESS = "ru_RU.UTF-8"; LC_MONETARY = "ru_RU.UTF-8"; + LC_NUMERIC = "ru_RU.UTF-8"; LC_PAPER = "ru_RU.UTF-8"; + LC_TELEPHONE = "ru_RU.UTF-8"; }; i18n.supportedLocales = [ "C.UTF-8/UTF-8" + "en_DK.UTF-8/UTF-8" + "en_GB.UTF-8/UTF-8" + "en_IE.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" "ru_RU.UTF-8/UTF-8" - "en_GB.UTF-8/UTF-8" ]; - time.timeZone = "Europe/Helsinki"; + time.timeZone = "Europe/Vienna"; environment.sessionVariables = { XKB_DEFAULT_LAYOUT = "us,ru"; XKB_DEFAULT_OPTIONS = "grp:win_space_toggle"; - LANGUAGE = "en_US.UTF-8"; - LC_ALL = "en_US.UTF-8"; }; # Hardened diff --git a/profiles/workspace/locale.nix b/profiles/workspace/locale.nix index ccfa723..d682cfd 100644 --- a/profiles/workspace/locale.nix +++ b/profiles/workspace/locale.nix @@ -1,29 +1,32 @@ { config, ... }: let - en = "en_US.UTF-8"; + c = "C.UTF-8"; + dk = "en_DK.UTF-8"; + gb = "en_GB.UTF-8"; + ie = "en_IE.UTF-8"; ru = "ru_RU.UTF-8"; + us = "en_US.UTF-8"; + lang = "en_IE:en:C:ru_RU"; in { - i18n.defaultLocale = en; + i18n.defaultLocale = ie; i18n.extraLocaleSettings = { - LANGUAGE = en; - LC_ALL = en; - LC_TIME = en; + LANGUAGE = lang; + LC_TIME = dk; LC_ADDRESS = ru; LC_MONETARY = ru; + LC_NUMERIC = ru; LC_PAPER = ru; + LC_TELEPHONE = ru; }; - i18n.supportedLocales = [ - "C.UTF-8/UTF-8" - "en_US.UTF-8/UTF-8" - "en_GB.UTF-8/UTF-8" - "ru_RU.UTF-8/UTF-8" + i18n.supportedLocales = map (x: "${x}/UTF-8") [ + c dk gb ie ru us ]; environment.sessionVariables = { XKB_DEFAULT_LAYOUT = "us,ru"; XKB_DEFAULT_OPTIONS = "grp:win_space_toggle"; - LANGUAGE = en; - LC_ALL = en; + # LANGUAGE = lang; + # LC_ALL = en; }; time.timeZone = "Europe/Moscow"; @@ -36,11 +39,16 @@ in { home-manager.users.${config.mainuser} = { home.language = { + base = ie; + time = dk; address = ru; monetary = ru; + numeric = ru; paper = ru; - time = en; - base = en; + telephone = ru; + }; + home.sessionVariables = { + LANGUAGE = lang; }; }; }