cosarara.me

The blog

Setting up guix, and locales

I wanted to try out Spritely Goblins to see what it is like, or to really understand what it is, since I’d been seeing it pop up on lobste.rs here and there.

The guide suggests using the guix package, so I decided to install the guix package manager on top of my arch linux system.

Installing asks to please run nscd, which is not even included in arch nowadays, so I did not, we’ll see what problems it causes. Then after it’s set up, runnig any guix command asked me to fix the locales:

hint: Consider installing the `glibc-locales' package and defining `GUIX_LOCPATH',
along these lines:

     guix install glibc-locales
     export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"

See the "Application Setup" section in the manual, for more info.

The Application Setup section in the manual says the full glibc-locales includes everything and thus is heavy, and suggests this invocation for a slimmer setup:

(use-modules (gnu packages base))

(define my-glibc-locales
  (make-glibc-utf8-locales
   glibc
   #:locales (list "en_CA" "fr_CA" "ik_CA" "iu_CA" "shs_CA")
   #:name "glibc-canadian-utf8-locales"))

Apparently, you can drop that in a file (I removed the define, since we want to return the value), such as locales.scm:

(use-modules (gnu packages base))

(make-glibc-utf8-locales
  glibc
  #:locales (list "en_US" "ca_ES" "es_ES")
  #:name "glibc-my-utf8-locales")

And tell guix to install it as a package:

guix package --install-from-file=locales.scm

The env variable $GUIX_LOCPATH should be set automatically by /etc/profile.d/zzz-guix.sh on login, with a gotcha: It will try to set it up first for $HOME/.guix-profile (correct) but then overwrite it for $HOME/.guix-home/profile (which does not exist on my system because I’m not using guix home, for now). So I had to comment out that final section.

And then, I ran guix pull, and the glibc version had changed, so I had to re-install the package to upgrade it and fix the locales again. Also it turns out after that, there will be two different per-user guix profiles:

> guix package --list-profiles                              
/home/jaume/.config/guix/current
/home/jaume/.guix-profile

Which is a bit confusing but seems to work.

Also, the guix pull took forever, and the way to fix that seems to be to write the following to .config/guix/channels.scm:

(use-modules (guix ci))

(list (channel-with-substitutes-available
       %default-guix-channel
       "https://ci.guix.gnu.org"))

And then it will try to update only to versions which have binaries. Maybe probably.

—cosarara

Got any comments? Send me an email: blog@cosarara.me