Conflict between glibc and glibcLocales? (TL;DR I messed it up)

I just did a fresh install of NixOS (unstable channel) and I get errors like:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "",
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Since I just configured locale with i18n.defaultLocale and it’s a fresh install I don’t think this is relevant: glibc 2.27 breaks locale support · Issue #38991 · NixOS/nixpkgs · GitHub

Then I noticed that there’s something weird in the system-path build logs:

collision between `/nix/store/7ymwv89lvf5mrm9nqpm8i7cnbyx8fqka-glibc-locales-2.30/lib/locale/locale-archive' and `/nix/store/jx19wa4xlh9n4324xdl9rjnykd19mmq3-glibc-2.30/lib
/locale/locale-archive'

Therefore…

Workaround

Indeed, raising the priority of glibcLocales seems to fix this:

# (Based on the default value)

i18n.glibcLocales = lib.hiPrio (pkgs.buildPackages.glibcLocales.override {
  allLocales = lib.any (x: x == "all") config.i18n.supportedLocales;
  locales = config.i18n.supportedLocales;
});

As I didn’t find anything in the issue tracker other than what I found above, and that also didn’t mention conflicts AFAICT, I’m tempted to report an issue, but I thought I can’t be the only one to notice an issue with such a basic package. Any ideas on this? Anything I can do?

My configuration is at https://github.com/dramforever/config/tree/master/nixos (includes the workaround)

2 Likes