feat: locale module

This commit is contained in:
Dmitriy Kholkin 2025-03-10 18:35:29 +03:00
parent 0f43c2e01d
commit 57ab28592e
Signed by: AtaraxiaDev
GPG Key ID: FD266B810DF48DF2
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,44 @@
{ config, lib, ... }:
let
inherit (lib) mkDefault mkEnableOption mkIf;
cfg = config.ataraxia.defaults.locale;
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_US:en:C:ru_RU";
in
{
options.ataraxia.defaults.locale = {
enable = mkEnableOption "Default locale settings";
};
config = mkIf cfg.enable {
environment.sessionVariables = {
XKB_DEFAULT_LAYOUT = "us,ru";
XKB_DEFAULT_OPTIONS = "grp:win_space_toggle";
};
i18n.defaultLocale = ie;
i18n.extraLocaleSettings = {
LANGUAGE = lang;
LC_TIME = dk;
LC_ADDRESS = ru;
LC_MONETARY = ru;
LC_NUMERIC = ru;
LC_PAPER = ru;
LC_TELEPHONE = ru;
};
i18n.supportedLocales = map (x: "${x}/UTF-8") [
c
dk
gb
ie
ru
us
];
time.timeZone = mkDefault "Europe/Moscow";
};
}

View File

@ -32,6 +32,7 @@ in
config =
let
baseRole = {
ataraxia.defaults.locale.enable = mkDefault true;
ataraxia.defaults.lix.enable = mkDefault true;
ataraxia.defaults.nix.enable = mkDefault true;
ataraxia.defaults.ssh.enable = mkDefault true;