Glibc-locales in nixos 25.05

Although there is this code in glibc-locales.nix :

{
  lib,
  stdenv,
  buildPackages,
  callPackage,
  writeText,
  glibc,
  allLocales ? true,
  locales ? [ "en_US.UTF-8/UTF-8" ],   # here we do have UTF-8 in uppercase
  linuxHeaders,
  withLinuxHeaders ? !stdenv.cc.isGNU,
}

when switching back and forth between nixos 24.11 and 25.05, I get this error:

Running phase: buildPhase
C.UTF-8/UTF-8
aa_DJ.UTF-8/UTF-8
aa_DJ/ISO-8859-1

en_US.UTF-8/UTF-8
en_US/ISO-8859-1

fr_FR.UTF-8/UTF-8

zu_ZA/ISO-8859-1
Error: unsupported locales detected:
en_US.utf8/UTF-8
You should choose from the list above the error.
error: builder for ‘/nix/store/s3i8byc72grzmlclas4y91c8ds138ncf-glibc-locales-2.40-66.drv’ failed with exit code 1

I am a bit confused about the issue, because when putting the main nixos channel back to 24.11 then nixos-rebuild, the error disappears…

Any idea what I should look at so to start debugging? This does not seem at first dependent on any other packages… (or there are so many packages depending on a seemingly faulty glibc-locales, that it feels as if the error is elsewhere) but I have NOT spent enough time on the issue.

Maybe someone knows about this issue? Even better an existing fix :wink:
Otherwise, I can debug if you just indicate me the first obvious steps, as this seems a core issue (my feeling)

In my configuration.nix I have:

i18n.defaultLocale = “en_US.UTF8”;

i18n.extraLocaleSettings =
{
LC_ADDRESS = “fr_FR.UTF8”;
LC_IDENTIFICATION = “fr_FR.UTF8”;
LC_MEASUREMENT = “fr_FR.UTF8”;
LC_MONETARY = “fr_FR.UTF8”;
LC_NAME = “fr_FR.UTF8”;
LC_NUMERIC = “fr_FR.UTF8”;
LC_PAPER = “fr_FR.UTF8”;
LC_TELEPHONE = “fr_FR.UTF8”;
LC_TIME = “fr_FR.UTF8”;
};

Have you tried with UTF-8 (with a dash)?

1 Like

I have modified the configuration.nix, using dashes…

i18n.defaultLocale = “en_US.UTF-8”;
36 │
37 │ i18n.extraLocaleSettings =
38 │ {
39 │ LC_ADDRESS = “fr_FR.UTF-8”;
40 │ LC_IDENTIFICATION = “fr_FR.UTF-8”;
41 │ LC_MEASUREMENT = “fr_FR.UTF-8”;
42 │ LC_MONETARY = “fr_FR.UTF-8”;
43 │ LC_NAME = “fr_FR.UTF-8”;
44 │ LC_NUMERIC = “fr_FR.UTF-8”;
45 │ LC_PAPER = “fr_FR.UTF-8”;
46 │ LC_TELEPHONE = “fr_FR.UTF-8”;
47 │ LC_TIME = “fr_FR.UTF-8”;
48 │ };

But the error is still the same: en_US.utf8/UTF-8 (without dash and in lowercase)
while glibc/locales.nix is still using:

locales ? [ “en_US.UTF-8/UTF-8” ]

It seems like something else is feeding the “en_US.utf8/UTF-8” value

You helped me got the issue
I use a code-generation mechanism for my configuration.nix
and my ‘/etc/nixos/configuration.nix’ file has lost the the UPPERCASE

My bug is in the process of the copying my dedicated ‘services.nix’ file to /etc/nixos/, which is imported in my ‘configuration.nix’: Thus newer modifications had simply no effects.

It is TOTALLY on my side: the switching between 24.11 and 25.05 may only be a hint that the newer version is less permissive.

So we can consider the topic closed, as it is somewhat UNRELATED to nixos itself.
I think moderators could consider my thread OFF-TOPIC.