Locales

From NixOS Wiki
Revision as of 10:01, 31 July 2023 by L0b0 (talk | contribs) (Enable locale support in Nix shell)
Jump to: navigation, search

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-achive. 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

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";
}