diff options
| author | adikro <adikro@disroot.org> | 2025-12-20 03:14:45 +0100 |
|---|---|---|
| committer | adikro <adikro@disroot.org> | 2025-12-20 03:14:45 +0100 |
| commit | 791bc419b6dac7c70951981ef6b34cdf85828470 (patch) | |
| tree | 56d0962fdf829ae942feb1344763e54dbc3c89a3 /sys/core/localization.nix | |
| parent | e60410393cea222b16743a1a87f29c06b9b3543b (diff) | |
absolutely massive rewrite, made (almost) everything modular with changes to come
Diffstat (limited to 'sys/core/localization.nix')
| -rw-r--r-- | sys/core/localization.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sys/core/localization.nix b/sys/core/localization.nix new file mode 100644 index 0000000..0b046d4 --- /dev/null +++ b/sys/core/localization.nix @@ -0,0 +1,42 @@ +{ config, lib, ... }: +let + cfg = config.szpont.sys.core.locale; +in +{ + options.szpont.sys.core.locale = { + enable = lib.mkEnableOption "system localization (timezone and language)"; + + timeZone = lib.mkOption { + type = lib.types.str; + default = "Europe/Warsaw"; + description = "the system timezone."; + }; + + format = lib.mkOption { + type = lib.types.str; + default = "pl_PL.UTF-8"; + description = "the locale used for numbers, time, and measurements."; + }; + }; + + config = lib.mkIf cfg.enable { + time.timeZone = cfg.timeZone; + + i18n = { + defaultLocale = "en_US.UTF-8"; + + extraLocaleSettings = { + LC_TIME = cfg.format; + LC_NUMERIC = cfg.format; + LC_MONETARY = cfg.format; + LC_PAPER = cfg.format; + LC_MEASUREMENT = cfg.format; + LC_COLLATE = cfg.format; + LC_NAME = cfg.format; + LC_ADDRESS = cfg.format; + LC_TELEPHONE = cfg.format; + LC_IDENTIFICATION = cfg.format; + }; + }; + }; +} |
