Home Explore Blog CI



nixpkgs

1st chunk of `doc/packages/locales.section.md`
33c7965d676cd1ed9b232a30ce437d45ac0422e5ff7c9f8600000001000002fe
# Locales {#locales}

To allow simultaneous use of packages linked against different versions of `glibc` with different locale archive formats, Nixpkgs patches `glibc` to rely on `LOCALE_ARCHIVE` environment variable.

On non-NixOS distributions, this variable is obviously not set. This can cause regressions in language support or even crashes in some Nixpkgs-provided programs. The simplest way to mitigate this problem is exporting the `LOCALE_ARCHIVE` variable pointing to `${glibcLocales}/lib/locale/locale-archive`. The drawback (and the reason this is not the default) is the relatively large (a hundred MiB) size of the full set of locales. It is possible to build a custom set of locales by overriding parameters `allLocales` and `locales` of the package.

Title: Locales in Nixpkgs and glibc
Summary
Nixpkgs patches glibc to use the `LOCALE_ARCHIVE` environment variable to allow using packages linked against different glibc versions with different locale archive formats. On non-NixOS distributions, this variable might not be set, causing issues with language support. Setting `LOCALE_ARCHIVE` to `${glibcLocales}/lib/locale/locale-archive` can fix this, but increases size. Custom locale sets can be built by overriding `allLocales` and `locales` parameters.