diff options
author | Gaute Ravndal <gaute.ravndal@gmail.com> | 2022-06-26 16:24:31 +0200 |
---|---|---|
committer | Gaute Ravndal <gaute.ravndal@gmail.com> | 2022-06-27 00:02:04 +0200 |
commit | d534fa7085900882da0ca9b5ac0e5ad7c5070c81 (patch) | |
tree | 45dc8af870a09620fd18faa4576d0d16df4d69dd | |
parent | 9a17f325397d137ac4d219ecbd5c7f15154422f4 (diff) | |
download | nixpkgs-d534fa7085900882da0ca9b5ac0e5ad7c5070c81.tar nixpkgs-d534fa7085900882da0ca9b5ac0e5ad7c5070c81.tar.gz nixpkgs-d534fa7085900882da0ca9b5ac0e5ad7c5070c81.tar.bz2 nixpkgs-d534fa7085900882da0ca9b5ac0e5ad7c5070c81.tar.lz nixpkgs-d534fa7085900882da0ca9b5ac0e5ad7c5070c81.tar.xz nixpkgs-d534fa7085900882da0ca9b5ac0e5ad7c5070c81.tar.zst nixpkgs-d534fa7085900882da0ca9b5ac0e5ad7c5070c81.zip |
nixos/i18n: include locales from extraLocaleSettings in supportedLocales
-rw-r--r-- | nixos/doc/manual/from_md/release-notes/rl-2211.section.xml | 10 | ||||
-rw-r--r-- | nixos/doc/manual/release-notes/rl-2211.section.md | 4 | ||||
-rw-r--r-- | nixos/modules/config/i18n.nix | 14 |
3 files changed, 20 insertions, 8 deletions
diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml index 492df2d828a..3d08f9a8912 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml @@ -192,10 +192,12 @@ <listitem> <para> <literal>i18n.supportedLocales</literal> is now by default - only generated with the default locale set in - <literal>i18n.defaultLocale</literal>. This got copied over - from the minimal profile and reduces the final system size by - 200MB. If you require all locales installed set the option to + only generated with the locales set in + <literal>i18n.defaultLocale</literal> and + <literal>i18n.extraLocaleSettings</literal>. This got + partially copied over from the minimal profile and reduces the + final system size by up to 200MB. If you require all locales + installed set the option to <literal>[ "all" ]</literal>. </para> </listitem> diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md index 0c5342f729a..4abb32f551e 100644 --- a/nixos/doc/manual/release-notes/rl-2211.section.md +++ b/nixos/doc/manual/release-notes/rl-2211.section.md @@ -80,8 +80,8 @@ In addition to numerous new and upgraded packages, this release has the followin and [changelog](https://ngrok.com/docs/ngrok-agent/changelog). Notably, breaking changes are that the config file format has changed and support for single hypen arguments was dropped. -- `i18n.supportedLocales` is now by default only generated with the default locale set in `i18n.defaultLocale`. - This got copied over from the minimal profile and reduces the final system size by 200MB. +- `i18n.supportedLocales` is now by default only generated with the locales set in `i18n.defaultLocale` and `i18n.extraLocaleSettings`. + This got partially copied over from the minimal profile and reduces the final system size by up to 200MB. If you require all locales installed set the option to ``[ "all" ]``. - The `isPowerPC` predicate, found on `platform` attrsets (`hostPlatform`, `buildPlatform`, `targetPlatform`, etc) has been removed in order to reduce confusion. The predicate was was defined such that it matches only the 32-bit big-endian members of the POWER/PowerPC family, despite having a name which would imply a broader set of systems. If you were using this predicate, you can replace `foo.isPowerPC` with `(with foo; isPower && is32bit && isBigEndian)`. diff --git a/nixos/modules/config/i18n.nix b/nixos/modules/config/i18n.nix index 53dd325457e..c55726d09c6 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 |