Hi,

On Sun, 01 May 2022 at 16:01, Kyle Andrews <[email protected]> wrote:
> How can I configure the offload functionality to check whether the build
> machines specifiec in ~/etc/guix/machines.scm~ are available first; and
> if they are not (e.g. because I am roaming outside my local network)
> just proceed with builds locally so that I don't have to remember to
> pass --no-offload?

As discussed in this old and still open bug#24496 [1], you could do
something like that for ’/etc/guix/machines.scm’:

--8<---------------cut here---------------start------------->8---
(define the-machine (build-machine …))

  (if (managed-to-connect-timely the-machine)
      (list the-machine)
      '())
--8<---------------cut here---------------end--------------->8---

where ’managed-to-connect-timely’ could be a plain ’system*’ call via
’ping’ to the target offload machine.  Guile probably provides a better
interface for network check. :-)

However, note that it could be nice to have something dynamically
handled [2] by the daemon.  Feature missing…


1: <https://issues.guix.gnu.org/issue/24496#3>
2: <https://yhetil.org/guix/[email protected]>


Cheers,
simon

Reply via email to