Locales: Difference between revisions
imported>Raicuparta No edit summary |
imported>Pmorch No edit summary |
||
Line 5: | Line 5: | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang=bash> | ||
export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive | export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive | ||
</syntaxhighlight> | |||
And if that file from the local system is somehow broken: | |||
<syntaxhighlight lang=bash> | |||
export LOCALE_ARCHIVE="$(nix-env --installed --no-name --out-path --query glibc-locales)/lib/locale/locale-archive" | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 13:45, 27 March 2024
Troubleshooting when using nix on non-NixOS linux distributions
You may need to set the environmental variable LOCALE_ARCHIVE to point to your system's locale-archive. The following can be added to your .zshenv (zsh) or .profile (bash) and applies to Debian, Red Hat, and Arch derivatives:
export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive
And if that file from the local system is somehow broken:
export LOCALE_ARCHIVE="$(nix-env --installed --no-name --out-path --query glibc-locales)/lib/locale/locale-archive"
Enable locale support in Nix shell
To support locales within a Nix shell, for example to get localised command output, you need to do something similar:
pkgs.mkShell {
# [other code omitted]
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
}