Subject: bug#51348: Exception on `guix install nss-certs`

From: Leo Famulari <[email-masked]>
Date: Sat, 23 Oct 2021 16:04:03 -0400

On Sat, Oct 23, 2021 at 10:57:20AM +0000, Raimundo Martins via Bug reports for GNU Guix wrote:
> Hi! I'm having an exception when trying to install nss-certs. I have glibc-utf8-locales installed, and even tried installing glibc-locales even though my LANG=en_US.UTF-8.
> I'm running Guix the package manager on top of Void Linux.

Right, you can use glibc-utf8-locales (a random locale collection
intended for test purposes) to get en_US.UTF-8

> Throw to key `encoding-error' with args `("scm_to_stringn" "cannot convert wide string to output locale" 84 #f #f)'.

Did you set GUIX_LOCPATH, as suggested in the Application Setup section
of the manual?

https://guix.gnu.org/manual/en/html_node/Application-Setup.html

I'm not sure exactly which context this error occurs in, but I recommend
setting GUIX_LOCPATH in two places:

1) Your user's login environment. That is, ~/.bash_profile or equivalent
for your shell, like this:

export GUIX_LOCPATH=$HOME/.guix-profile/lib/locale

Remember that you'll have to re-login to make it effective. This can be
done with `bash --login`.

2) The guix-daemon's environment. On Debian, that means adding a line
like this to the Service section of guix-daemon.service and reloading
and restarting the service:

Environment=GUIX_LOCPATH=/var/guix/profiles/per-user/root/guix-profile/lib/locale

Does Void Linux use runit instead of systemd? I'm sure there is a way to
export environment variables in service contexts with runit.