Home Explore Blog Models CI



nixpkgs

doc/packages/locales.section.md
419e9720da9fddab20ac9f9345e3de3e52315447deac030d0000000300000302
# 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 the `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.

Chunks
8f7adf6a (1st chunk of `doc/packages/locales.section.md`)
Title: Handling Locales in Nixpkgs for Glibc
Summary
Nixpkgs modifies `glibc` to use the `LOCALE_ARCHIVE` environment variable, enabling the use of packages linked against different `glibc` versions. On non-NixOS systems, this variable is not set by default, potentially causing language support regressions or program crashes. The recommended solution is to export `LOCALE_ARCHIVE` pointing to `${glibcLocales}/lib/locale/locale-archive`, though this adds a 100 MiB dependency. Alternatively, users can build a custom, smaller locale set by overriding the `allLocales` and `locales` package parameters.