guix-devel
[Top][All Lists]
Advanced

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

Re: On the naming of System and Home services modules.


From: Maxime Devos
Subject: Re: On the naming of System and Home services modules.
Date: Wed, 15 Sep 2021 12:09:16 +0200
User-agent: Evolution 3.34.2

Andrew Tropin schreef op wo 15-09-2021 om 11:47 [+0300]:
> *** Confusion
> I already mentioned that I see a lot of confusion between System and
> Shepherd services and I expect some confusion between home and system
> services, it will be especially true if we place them in the same
> namespace.
> 
> People will be trying to use home services inside operating systems,
> #+begin_src scheme
> (operating-system
>   (services
>    (list (service home-mcron-service-type ...))))
> #+end_src
> 
> and configuration record for system services inside home services.
> #+begin_src scheme
> (home-environment
>  ... (service home-mcron-service-type
>               (mcron-configuration ...)))
> #+end_src

What do you think of adding some validation code to 'service-type'
and the "guix home" equivalent, e.g. a ‘validate’ field, which
could be used like

(define-module (...)
  #:autoload (gnu home??? mcron) (mcron-user-configuration?))

(define mcron-service-type
  (service-type (name 'mcron)
                ...
                (validate
                  (lambda (config)
                    (cond ((mcron-configuration? config) #t)
                          ((home-mcron-configuration? config)
                           ;; TODO: figure out a clear error message
                           (validation-error (G_ "A mcron configuration for the 
system was expected, but a configuration for the user was used")))
                          (#t #f))))))

and likewise for the "guix home" equivalent, such that if user configurations
are used in the system configuration, an error message is printed, indicating
the issue?  Maybe include the line and column number of the record as well.

Greetiings,
Maxime.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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