huh, strace locale
gives a lot of ENOENT
for en_US
paths in glibc’s part of the Nix store… is that a clue?
[rkb@nixos:~/projects/nixpkgs]$ strace -e trace=file locale
execve("/run/current-system/sw/bin/locale", ["locale"], 0x7ffe7819bd90 /* 83 vars */) = 0
access("/etc/ld-nix.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/tls/haswell/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/tls/haswell/x86_64", 0x7ffcd952f2b0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/tls/haswell/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/tls/haswell", 0x7ffcd952f2b0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/tls/x86_64", 0x7ffcd952f2b0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/tls", 0x7ffcd952f2b0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/haswell/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/haswell/x86_64", 0x7ffcd952f2b0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/haswell/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/haswell", 0x7ffcd952f2b0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/x86_64", 0x7ffcd952f2b0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/nix/store/8kw71xqs5bz6s68dylv6y13082zn0023-glibc-locales-2.27/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/locale/en_SE.UTF-8/LC_MEASUREMENT", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/locale/en_SE.utf8/LC_MEASUREMENT", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/locale/en_SE/LC_MEASUREMENT", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/locale/en.UTF-8/LC_MEASUREMENT", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/locale/en.utf8/LC_MEASUREMENT", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/lib/locale/en/LC_MEASUREMENT", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_SE.UTF-8
LC_TIME=en_SE.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT=en_SE.UTF-8
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
+++ exited with 0 +++
$ ls /nix/store/bpgdx6qqqzzi3szb0y3di3j3660f3wkj-glibc-2.31/share/locale/
be bg ca cs da de el en_GB eo es fi fr gl hr hu ia id it ja ko locale.alias lt nb nl pl pt pt_BR ru rw sk sl sv tr uk vi zh_CN zh_TW
Why would I have en_GB
and all the rest, but not en_US
?
I’m already setting supportedLocales = [ "all" ];
in configuration.nix… what else should I do?
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_MEASUREMENT = "en_SE.UTF-8";
LC_NUMERIC = "en_SE.UTF-8";
# For dates formatted like ISO8601
LC_TIME = "en_SE.UTF-8";
};
supportedLocales = [ "all" ];
};