Subject: [bug#70314] [PATCH] guix: scripts: environment: add tls certs to networked containers

From: Simon Tournier <[email-masked]>
Date: Fri, 20 Sep 2024 17:19:59 +0200

Hi Ludo,

On dim., 15 sept. 2024 at 23:49, Ludovic Courtès <[email-masked]> wrote:

>> +  #:autoload   (gnu packages certs) (nss-certs)

[...]

>> +(define %default-tls-certs
>> +  (list nss-certs))

>
> This would force all the package modules to be loaded upfront.  Instead
> you should arrange to not refer to ‘nss-certs’ until it’s needed.

This is a question I had but not reported when commenting elsewhere this
patch.  I was thinking to suggest:

    (module-ref (resolve-interface '(gnu packages certs)) 'nss-certs)

which lazily loads, IIUC.  Then I gave a look to Guile manual which
mentions:

     ‘#:autoload MODULE SYMBOL-LIST’
[...]
          An autoload is a good way to put off loading a big module
          until it’s really needed, for instance for faster startup or
          if it will only be needed in certain circumstances.

Therefore, could you explain the difference if there is one?

Cheers,
simon