This NixOS code ensures that the system provide version-specific $LOCALE_ARCHIVE
environment variables to mitigate the effects of
NixOS/nixpkgs#38991.
To deploy it, copy the file into your /etc/nixos
folder using a file name
like multi-glibc-locale-paths.nix
. Then edit your configuration.nix
file to
contain the attribute:
imports = [ ./multi-glibc-locale-paths.nix ];
If you are running Nix on a host system other than NixOS, you'll have to configure those environment variables manually:
-
Set
$LOCALE_ARCHIVE_2_27
to the path"${glibcLocales}/lib/locale/locale-archive"
. You can find out whatglibcLocales
is by running:$ nix-build --no-out-link "<nixpkgs>" -A glibcLocales /nix/store/m53mq2077pfxhqf37gdbj7fkkdc1c8hc-glibc-locales-2.27
-
Set
$LOCALE_ARCHIVE_2_11
to the path of your system's locale.
I noticed that even with this module deployed,
LOCALE_ARCHIVE_2_11
never made it into services likehydra-queue-runner.service
, which was the thing emitting all the Perl locale warning spam for me. I managed to fix it by patching hydra:(Even more fun: this can't be used in combination with the module in this gist because the environmental variable conflicts.)