diff options
| author | adi <adikro@disroot.org> | 2026-07-29 17:09:58 +0200 |
|---|---|---|
| committer | adi <adikro@disroot.org> | 2026-07-29 17:09:58 +0200 |
| commit | 39a2b09c27bb74c9e59d1772764f901e3c8fb9e4 (patch) | |
| tree | 0ba58e6fbf086a85d875df1c10f6d23bc3bbc7da /modules/localization.nix | |
| parent | 8a820cacee1ff07ae7397d053b26e66f7086a4a4 (diff) | |
revamped flake.nix, removed homelab specific modulesstaging
Diffstat (limited to 'modules/localization.nix')
| -rw-r--r-- | modules/localization.nix | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/modules/localization.nix b/modules/localization.nix new file mode 100644 index 0000000..49933fa --- /dev/null +++ b/modules/localization.nix @@ -0,0 +1,41 @@ +{ config, lib, ... }: +let + cfg = config.os.core.locale; +in +{ + options.os.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; + }; + }; + }; +} |
