all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Christopher Allan Webber <cwebber@dustycloud.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Composing service definitions (and maybe fmt)
Date: Sun, 24 Jan 2016 21:35:17 +0100	[thread overview]
Message-ID: <87twm2lnqy.fsf@gnu.org> (raw)
In-Reply-To: <87bn8e4m9a.fsf@dustycloud.org> (Christopher Allan Webber's message of "Thu, 21 Jan 2016 13:57:18 -0800")

Christopher Allan Webber <cwebber@dustycloud.org> skribis:

> You may remember my post to the list about how I'm interested in
> service configurations which know about each others' variables.  I wrote
> about why I think this is really important to solving deployment here:
>
>   http://lists.gnu.org/archive/html/guix-devel/2015-09/msg00736.html
>
> If we build procedures which go from procedure inputs -> text and that's
> all that gets passed to the service, do we lose the ability to
> introspect the arguments being used to set up the service?

Not necessarily: <service> object have a ‘parameters’ field to hold the
service’s arguments, and this can always be introspected and
manipulated.

It’s just that there’s a “preferred form” to manipulate these service
parameters.  For instance, a high-level struct is easy to deal with, an
argument list is OK but less convenient, and a file-like object is
pretty bad.

> Would it be possible to have services which themselves set up services?
> Eg, imagine I had something imaginary like:
>
>   (3dprinter-service
>    #:model "lawlsbot-3000"
>    #:fill-pattern "hex")
>
> (Ignore whether or not this is a sane way to configure a 3d printer at
> all at the moment, I'm just making something up)
>
> So, this might actually build the "implied" service of:
>
>   (3dprinter-raw-service
>    "[printconfig]
> model = lawlsbot-3000
> fill-pattern = hex")
>
> ... this way, daring users can provide their own config file if our
> config file builders aren't good enough, but it's still possible to
> have some other service or tool read that the 3dprinter-service has a
> model with lawlsbot-3000, so it can show it in a menu, or something.
>
> Is this possible, or even sane? :)

So you’re suggesting to systematically have a high-level interface as
well as a lower-level interface that gives access to the raw config
file, right?

The problem is that often, the service configuration does not to just
one config file.  Often it also translates into command-line options,
user accounts, etc.  For instance, ‘tor-service’ expects users to pass a
raw config file, but it also needs to create a user account whose name
is given in that config file, so it needs to control that part of the
config file.

That being said, it’s always possible to extend ‘etc-service-type’ and
give it raw config files.

Not offering any concrete solution but… does that make sense?  :-)

Thanks,
Ludo’.

  reply	other threads:[~2016-01-24 20:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-16 23:03 Composing service definitions (and maybe fmt) Christopher Allan Webber
2016-01-19 13:14 ` Ricardo Wurmus
2016-01-19 15:58   ` Christopher Allan Webber
2016-01-20  9:37     ` Ricardo Wurmus
2016-01-20 17:49       ` Christopher Allan Webber
2016-01-20 22:13         ` Ludovic Courtès
2016-01-21 14:12           ` Thompson, David
2016-01-21 21:27             ` Ludovic Courtès
2016-01-21 21:57               ` Christopher Allan Webber
2016-01-24 20:35                 ` Ludovic Courtès [this message]
2016-01-24 22:18                   ` Christopher Allan Webber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87twm2lnqy.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=cwebber@dustycloud.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.