How can i improve performance?

Guix is painfully slow for me. Everytime i run guix system reconfigure i can put my notebook on the side and do something else for 15 minutes to an hour. Eventually i will get back to a command prompt after that time, but that it is really not fun when trying things out and experimenting with new stuff. What are things that i can do to improve speed?
I already changed the guix channel from savannah to codeberg, configured substituters for all the channels that i pull from, but it is still soooo slow. Should i put more things into the home configuration? Also maybe im blindsided by the console not giving any output for long periods during that process. Can i maybe make it more verbose so i know and get a glimpse into what is going on?

1 Like

A lot of testing can be done by combining guix shell and guix repl. Have you considered this option and found it not ergonomic enough?

1 Like

Oh interesting, i was reading the manual for setting up channels, packages and services so far. Thanks, I will try them out!

Maybe this is too complicated of a solution, but maybe it’s relevant?

We can speed up the downloading, building and updating of Guix packages by running a caching substitution server on the local network.

Also, how did you do that?

how did you do that?

I defined a new variable called override-channels in my /etc/config.scm

(define override-channels
  (list
    (channel
      (name 'guix)
      (url "https://codeberg.org/guix/guix.git")
      (branch "master")
      (introduction
        (make-channel-introduction
          "9edb3f66fd807b096b48283debdcddccfea34bad"
          (openpgp-fingerprint
            "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA"))))
    (channel
      (name 'nonguix)
      (url "https://gitlab.com/nonguix/nonguix")
      (introduction
        (make-channel-introduction
          "897c1a470da759236cc11798f4e0a5f7d4d59fbc"
          (openpgp-fingerprint
            "2A39 3FFF 68F4 EF7A 3D29  12AF 6F51 20A0 22FB B2D5"))))))

And then i used that in my os configuration

(operating-system
  ...
  (services
        (append
          (list
            (service openssh-service-type)
            ...
          (modify-services %desktop-services
            (guix-service-type
              config => (guix-configuration
                (inherit config)
                (channels override-channels)
                (guix (guix-for-channels override-channels))

see Customizing the System-Wide Guix (GNU Guix Reference Manual) for more on that

Beware, classic hen-egg problem, once you changed your config, you need to rebuild guix with guix system reconfigure first, before adding new packages from those channels. Only after that will guix use the new channels. Then you can do guix pull, add your new stuff to your config and then it will get its packages from those channels.

Also thanks for the suggestion, i will add local caching substituters next.

Ah, all we have to do is change that URL. Oook.

For me, I didn’t need system-wide channel configuration. I updated my ~/.config/guix/channels.scm to a new URL.

(list (channel
        (name 'nonguix)
        (url "https://gitlab.com/nonguix/nonguix")
        (branch "master")
        (introduction
          (make-channel-introduction
            "897c1a470da759236cc11798f4e0a5f7d4d59fbc"
            (openpgp-fingerprint
              "2A39 3FFF 68F4 EF7A 3D29  12AF 6F51 20A0 22FB B2D5"))))
      (channel
        (name 'guix)
        (url "https://git.guix.gnu.org/guix.git")
        (branch "master")
        (introduction
          (make-channel-introduction
            "9edb3f66fd807b096b48283debdcddccfea34bad"
            (openpgp-fingerprint
              "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA")))))

By the way, guix/guix: Transactional package manager, declarative GNU/Linux distribution, reproducible deployment tool, and more! - Codeberg.org points to Codeberg. I think the idea is that git.guix.gnu.org will point to wherever the current Guix repo is. This way we don’t have to update the URL in the future.


Also, I learned about different substitute servers from here: Group:Guix/Mirrors - LibrePlanet

They only have a few, but I was able to pick a server that was closer to me.

(Someone needs to make a tool like reflector, but for Guix…)

Then I updated my system config, as documented here: Getting Substitutes from Other Servers (GNU Guix Reference Manual)

(operating-system
  ;; …
  (services
    ;; Assume we're starting from '%desktop-services'.  Replace it
    ;; with the list of services you're actually using.
    (modify-services %desktop-services
      (guix-service-type config =>
                        (guix-configuration
                          (inherit config)
                          (substitute-urls
                            (append (list "https://guix.example.org")
                                    %default-substitute-urls))
                          (authorized-keys
                            (append (list (local-file "./key.pub"))
                                    %default-authorized-guix-keys)))))))

Honestly, still slow tho. :joy_cat:

I would recommend appending nonguix to %default-channels in your channels rather than managing the official Guix channels manually