Difference between revisions of "Locales"

From NixOS Wiki
Jump to: navigation, search
(Add warning about the new wiki)
m (rollback unauthorized mass edits)
Tag: Rollback
 
Line 1: Line 1:
{{warning|1=You are reading an article on the deprecated unofficial wiki. For the up to date version of this article, see https://wiki.nixos.org/wiki/Locales.}}
 
 
 
== Troubleshooting when using nix on non-NixOS linux distributions ==
 
== Troubleshooting when using nix on non-NixOS linux distributions ==
  

Latest revision as of 11:02, 6 April 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:

# May require a one-time installation with: nix-env -iA nixpkgs.glibcLocales
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";
}