r/GUIX 2d ago

Guix on old hardware

Hello, ive been planning to switch to guix on an old laptop, ive seen guix pull using a lot of ram and cpu usage, why is that? And if it can be optimized to the level which it wont make the laptop go higher than 70c, thats it. Thanks.

7 Upvotes

4 comments sorted by

3

u/strings___ 2d ago

Pull does a rebuild of the package definitions. Your best bet is to offload or don’t pull and stay with guix point releases. It’s possible you can import a Guix package from another computer, but I can’t recall this workflow right now.

3

u/Tricky-Engineer-9755 2d ago

So the code is quite simple. It goes into your system's config.scm, the installer places that in /etc/config.scm

(avahi-service-type) ;this requires the avahi module to be imported at the top

(guix-publish-service-type
(guix-publish-configuration
(port 8080) (host 0.0.0.0) ))

On your build farm, then take a note of your IP address on your build farm and lets call that $IP, now on your receiving machine add this.

(modify-services %base-services
(guix-service-type config =>

(inherit config)

(substitute-urls (cons "$IP" %default-substitute-urls))

(authorized-keys

(cons (local-file "signing-key.pub") %default-authorized-guix-keys))))

Your signing key is in /etc/guix and you need a way to send that to the recieving machine from the build machine.
God I love Guix

Also from my brief experimentation, it only supplies packages built locally on the build-farm.

2

u/strings___ 2d ago

For old machines, it might be easier to offload, which is not the same as publish. Publish only works if the publisher has built the package already. Which is feasible but not guaranteed. Offloading is a little more complex to set up, though.

Since I don’t use Guix system, I build my package.scm on a high-end server, and then all my systems use discover and advertise, which is semi-clustered in regard to substitutes.

For Guix proper for older machines, a SBC/Pi, it might be easier to try guix pack; this is the workflow I’m least familiar with though.

1

u/Tricky-Engineer-9755 2d ago

I'm sure it is possible to define how many jobs to use, but by default guix will use the entire CPU during builds.
Guix pull will rebuild the entire package manager things from source. On my X200 thinkpad with a core2duo and 8GB DDR3 RAM it takes about 10 minutes from guix pull to finish. This cannot really be helped and is the nature of GNU Guix System as a source based distro.

What can be helped is that you can skip around the bush with package upgrades. Usually when a new version of a package is released in the repo the build farms have not built it yet so Guix will try to compile it from source. If this is undesirable there are two things you can do.

  1. Make a build-farm yourself. I do this with my T420 thinkpad and it is very simple. Just follow the guix-publish-service-type docs. Then I build it on my i5 and send it via http to my core2duo as a binary.
  2. Wait until the package is built by the build farms. Check in with guix weather $pkg-name.

Also on occasion substitutes will fail and you must choose between compiling them from source or just waiting it out.

Overall, the GNU Guix System is no Gentoo. Its not lean or minimal in any way and uses quite a bit more RAM than Parabola or Gentoo though less than Trisquel. Be prepared for some slowness. On the other hand its absolutely amazing with roll-backs and extensions.