This repository has been archived on 2025-10-08. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
nixos-config/options/host/locale.nix

43 lines
883 B
Nix

{
lib,
pkgs,
config,
...
}:
let
cfg = config.host.locale;
in
{
options = {
host.locale = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Basic locale settings.";
};
timeZone = lib.mkOption {
type = lib.types.str;
default = "America/New_York";
description = "Time Zone Locale.";
};
};
};
config = lib.mkIf cfg.enable {
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
time.timeZone = cfg.timeZone;
};
}