about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorGaute Ravndal <gaute.ravndal@gmail.com>2022-06-26 16:24:31 +0200
committerGaute Ravndal <gaute.ravndal@gmail.com>2022-06-27 00:02:04 +0200
commitd534fa7085900882da0ca9b5ac0e5ad7c5070c81 (patch)
tree45dc8af870a09620fd18faa4576d0d16df4d69dd /nixos/modules
parent9a17f325397d137ac4d219ecbd5c7f15154422f4 (diff)
nixos/i18n: include locales from extraLocaleSettings in supportedLocales
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/config/i18n.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/nixos/modules/config/i18n.nix b/nixos/modules/config/i18n.nix
index 53dd325457e01..c55726d09c608 100644
--- a/nixos/modules/config/i18n.nix
+++ b/nixos/modules/config/i18n.nix
@@ -53,8 +53,18 @@ with lib;
 
       supportedLocales = mkOption {
         type = types.listOf types.str;
-        default = [ (config.i18n.defaultLocale + "/UTF-8") ];
-        defaultText = literalExpression "[ (config.i18n.defaultLocale + \"/UTF-8\") ]";
+        default = builtins.map (l: l + "/UTF-8")
+          (unique (
+            [ config.i18n.defaultLocale ] ++
+            (attrValues (filterAttrs (n: v: n != "LANGUAGE") config.i18n.extraLocaleSettings))
+          ));
+        defaultText = literalExpression ''
+          builtins.map (l: l + "/UTF-8")
+            (unique (
+              [ config.i18n.defaultLocale ] ++
+              (attrValues (filterAttrs (n: v: n != "LANGUAGE") config.i18n.extraLocaleSettings))
+            ))
+        '';
         example = ["en_US.UTF-8/UTF-8" "nl_NL.UTF-8/UTF-8" "nl_NL/ISO-8859-1"];
         description = ''
           List of locales that the system should support.  The value