36
modules/nixos/system/locale.nix
Normal file
36
modules/nixos/system/locale.nix
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) types mkOption;
|
||||
in {
|
||||
options = {
|
||||
module.locale = mkOption {
|
||||
type = types.strMatching "[a-z]{2}_[A-Z]{2}\\.UTF-8";
|
||||
default = "en_US.UTF-8";
|
||||
description = "set locale";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
i18n = let
|
||||
inherit (config.module) 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user