2024-06-15 18:29:36 -03:00
|
|
|
{
|
2024-06-16 20:08:29 -03:00
|
|
|
config,
|
|
|
|
|
lib,
|
|
|
|
|
...
|
|
|
|
|
}: let
|
|
|
|
|
cfg = config.profiles.locale;
|
|
|
|
|
in {
|
|
|
|
|
imports = [];
|
2024-06-15 18:29:36 -03:00
|
|
|
options.profiles.locale = with lib;
|
2024-06-16 20:08:29 -03:00
|
|
|
with lib.types; {
|
|
|
|
|
enable = mkEnableOption "";
|
|
|
|
|
locale = mkOption {
|
|
|
|
|
type = str;
|
|
|
|
|
default = "en_US.UTF-8";
|
|
|
|
|
};
|
|
|
|
|
extraLocales = mkOption {
|
|
|
|
|
type = attrsOf str;
|
|
|
|
|
default = rec {
|
|
|
|
|
LC_ADDRESS = "pt_BR.UTF-8";
|
|
|
|
|
LC_IDENTIFICATION = LC_ADDRESS;
|
|
|
|
|
LC_MEASUREMENT = LC_ADDRESS;
|
|
|
|
|
LC_MONETARY = LC_ADDRESS;
|
|
|
|
|
LC_NAME = LC_ADDRESS;
|
|
|
|
|
LC_NUMERIC = LC_ADDRESS;
|
|
|
|
|
LC_PAPER = LC_ADDRESS;
|
|
|
|
|
LC_TELEPHONE = LC_ADDRESS;
|
|
|
|
|
LC_TIME = LC_ADDRESS;
|
2024-06-15 18:29:36 -03:00
|
|
|
};
|
|
|
|
|
};
|
2024-06-16 20:08:29 -03:00
|
|
|
keymap.layout = mkOption {
|
|
|
|
|
type = str;
|
|
|
|
|
default = "br";
|
|
|
|
|
};
|
|
|
|
|
keymap.variant = mkOption {
|
|
|
|
|
type = str;
|
|
|
|
|
default = "";
|
|
|
|
|
};
|
|
|
|
|
keymap.console = mkOption {
|
|
|
|
|
type = str;
|
|
|
|
|
default = "br-abnt2";
|
|
|
|
|
};
|
|
|
|
|
timeZone = mkOption {
|
|
|
|
|
type = str;
|
|
|
|
|
default = "America/Sao_Paulo";
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-06-15 18:29:36 -03:00
|
|
|
config = {
|
|
|
|
|
i18n = {
|
|
|
|
|
defaultLocale = cfg.locale;
|
|
|
|
|
extraLocaleSettings = cfg.extraLocales;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
services.xserver = {
|
|
|
|
|
xkb.layout = cfg.keymap.layout;
|
|
|
|
|
xkb.variant = cfg.keymap.variant;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
console.keyMap = cfg.keymap.console;
|
|
|
|
|
|
|
|
|
|
time = {
|
|
|
|
|
timeZone = cfg.timeZone;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|