Substitute-urls in system config (for firefox installation and upgrading)

Hi,

I had some trouble installing firefox without having to build it locally until I found this futurile blog post:

I am trying now to add this to my system config so whenever I upgrade (or port my config) I don’t need to add manually the substitute urls to the guix command.

Still a noob with Guile so asking for help on how should I add this to my conf.

Here is how I do it:

(define %nonguix-key
  (plain-file
   "nonguix-archive-key.pub"
   "(public-key
    (ecc
     (curve Ed25519)
     (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)))"))

(operating system
....
(services
   (append
       (modify-services %desktop-services
            (guix-service-type config =>
                              (guix-configuration
                              (inherit config)
                              (authorize-key? #f)
                              (discover? #t)
                              (authorized-keys
                               (append (list %nonguix-key)
                                             %default-authorized-guix-keys))
                              (substitute-urls
                              (append (list "https://substitutes.nonguix.org")
                                            %default-substitute-urls)))))
....
)
1 Like