How to add locales to a NixOS configuration?

I’m using standard the en_US.UTF-8 locale for language and stuff like that, but the fr_FR.UTF-8 locale for units, phone number, etc. Up to recently it worked well, but now that I’ve updated to the latest version of nixpkgs, there seem to be problems related to the locales: certain programs immediately crash after launch, such as rofi which just says (process:260582): Rofi-WARNING **: 15:16:56.480: Failed to set locale. and exits. Some other programs complain about the locale, but seem to resort to default values or things like that. Some accept to work if I launch them with LC_ALL=C in the environment.

When I try to list the available locales with locales -a, it just shows

$ locales -a
C
C.utf8
en_US.utf8
POSIX
$

evidently, the locale that I used to use is not installed anymore by default. I’ve tried adding fr_FR.UTF-8/UTF-8 to the i18n.supportedLocales option, and rebuild, but it doesn’t seem to be working. I’ve tried adding the "all" locale to that option, which is supposed to select all the available locales, but it doesn’t work either.

$ nix eval path/to/config#nixosConfigurations.hostname.config.i18n.supportedLocales
[ "C.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" "fr_FR.UTF-8/UTF-8" "it_IT.UTF-8/UTF-8" "all" ]
$

I don’t know what I’m supposed to do to have the locales installed.

In stable i18n.supportedLocales appears to work for me:

containers.example = {
  autoStart = true;
  ephemeral = true;

  config = {
    i18n.supportedLocales = [
      "C.UTF-8/UTF-8"
      "en_US.UTF-8/UTF-8"
      "fr_FR.UTF-8/UTF-8"
      "it_IT.UTF-8/UTF-8"
    ];
  };
};
$ sudo nixos-container run example -- locale --all-locales
C
C.utf8
en_US.utf8
fr_FR.utf8
it_IT.utf8
POSIX

After some experiments, I’ve concluded that this is due to not restarting my windows manager between each nixos-rebuild test.