guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding Substitute Mirrors page to installer


From: raid5atemyhomework
Subject: Re: Adding Substitute Mirrors page to installer
Date: Tue, 16 Mar 2021 01:07:07 +0000


>     The ability to also use the same mirror during install rather than after 
> it would be very nice. After all, the guix daemon has to be restarted during 
> installation in the meantime anyway, so on restart it should be possible to 
> switch the `substitute-urls`. However the complications are:
>
> -   The `(gnu installer service)` module inherently assumes that services are 
> completely orthogonal to everything else being configured in the 
> installation. I'm not sure what the best way to extract the substitute mirror 
> selection would be.
> -   The installation image has to do a local `guix system reconfigure` of 
> itself so that its shepherd points the guix daemon to a new mirror, so that 
> the guix daemon restart in `install-system` of `(gnu installer final)` will 
> refer to a new mirror.

Another way to do this would be to add another argument to the `start` action 
of `guix-daemon`, in much the same way the installer passes in its pid so that 
the guix daemon can access the copy-on-write store on the destination.  This 
argument would override the `--substitute-urls`.

So in `(gnu services base)` the `guix-shepherd-service` procedure would have 
something like:

    (define substitute-urls
            (match args
              ((_ substitute-urls . __) substitute-urls)
              (else                     #$(string-join substitute-urls))))

    #; ....

    (fork-exec-command/container
      #; ...
      #:pid
      (match args
        ((pid . _) pid)
        (else      (getpid)))
      #; ...)


The question now is how does the `install-system` procedure in `(gnu installer 
final)` determine what substitute URL to pass into `(start-service 'guix-daemon 
(list (number->string (getpid)) <>))`?

* Change the architecture of the installer somehow so that a single page can 
both manipulate the `services` field and also manipulate how `install-system` 
is invoked, and add a new argument to `install-system`.
* Or have `install-system` `read` in the `(%installer-configuration-file)`, 
look for the `operating-system` form, then delve in its `services` field for a 
`substitute-urls` field.  This feels fairly brittle but does take advantage of 
the homoiconicity of Scheme.

Thanks
raid5atemyhomework



reply via email to

[Prev in Thread] Current Thread [Next in Thread]