nixos/i18n: normalise locale codeset names in supportedLocales

This commit is contained in:
Gaute Ravndal 2022-07-06 18:33:21 +02:00
parent 49546f4413
commit cc0d38b58e

View file

@ -53,16 +53,16 @@ with lib;
supportedLocales = mkOption { supportedLocales = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = builtins.map (l: l + "/UTF-8") default = unique
(unique ( (builtins.map (l: (replaceStrings [ "utf8" "utf-8" "UTF8" ] [ "UTF-8" "UTF-8" "UTF-8" ] l) + "/UTF-8") (
[ [
"C.UTF-8" "C.UTF-8"
config.i18n.defaultLocale config.i18n.defaultLocale
] ++ (attrValues (filterAttrs (n: v: n != "LANGUAGE") config.i18n.extraLocaleSettings)) ] ++ (attrValues (filterAttrs (n: v: n != "LANGUAGE") config.i18n.extraLocaleSettings))
)); ));
defaultText = literalExpression '' defaultText = literalExpression ''
builtins.map (l: l + "/UTF-8") unique
(unique ( (builtins.map (l: (replaceStrings [ "utf8" "utf-8" "UTF8" ] [ "UTF-8" "UTF-8" "UTF-8" ] l) + "/UTF-8") (
[ [
"C.UTF-8" "C.UTF-8"
config.i18n.defaultLocale config.i18n.defaultLocale