Files
nixos-blueprint/modules/shared/nixos/locale.nix
T
2025-12-21 22:20:19 +02:00

44 lines
955 B
Nix

{
config,
lib,
...
}: let
inherit (lib) types mkOption;
in {
options = {
module.config = {
locale = mkOption {
type = types.strMatching "[a-z]{2}_[A-Z]{2}\\.UTF-8";
default = "en_US.UTF-8";
description = "set locale";
};
timeZone = mkOption {
type = types.str;
default = "Europe/Kyiv";
};
};
};
config = {
time.timeZone = config.module.config.timeZone;
i18n = let
inherit (config.module.config) locale;
in {
defaultLocale = locale;
extraLocaleSettings = {
LC_ADDRESS = locale;
LC_COLLATE = "en_US.UTF-8";
LC_CTYPE = locale;
LC_IDENTIFICATION = locale;
LC_MEASUREMENT = locale;
LC_MESSAGES = locale;
LC_MONETARY = locale;
LC_NAME = locale;
LC_NUMERIC = locale;
LC_PAPER = locale;
LC_TELEPHONE = locale;
LC_TIME = locale;
};
};
};
}