From 6728b50d3ad6826695af818f916d14927ba3b8fc Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 29 May 2021 20:23:19 +0200 Subject: [PATCH] modules: system: language: make it configurable --- modules/system/language.nix | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/modules/system/language.nix b/modules/system/language.nix index 48d9f30..f2bbcde 100644 --- a/modules/system/language.nix +++ b/modules/system/language.nix @@ -1,7 +1,22 @@ # Language settings -{ ... }: - +{ config, lib, ... }: +let + cfg = config.my.system.language; +in { - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; + options.my.system.language = with lib; { + enable = my.mkDisableOption "language configuration"; + + locale = mkOption { + type = types.str; + default = "en_US.UTF-8"; + example = "fr_FR.UTF-8"; + description = "Which locale to use for the system"; + }; + }; + + config = lib.mkIf cfg.enable { + # Select internationalisation properties. + i18n.defaultLocale = cfg.locale; + }; }