[Top][All Lists]

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

Re: Serializing service config to YAML

From: wolf
Subject: Re: Serializing service config to YAML
Date: Thu, 27 Jul 2023 17:16:35 +0200

On 2023-07-27 00:37:14 +0200, Csepp wrote:
> TakeV <> writes:
> > [[PGP Signed Part:Undecided]]
> > Hello there!
> >
> > I am attempting to create a service to run a package (specifically
> > this via shepherd.
> > I have the config defined as specified in the complex configuration
> > part of the manual, and I was wondering if there are any existing
> > examples of serializing configurations to YAML? Right now I have
> > everything passing directly into the command line, and being able to
> > serialize to a config and pass that in would be much cleaner, I
> > believe.
> >
> > Thanks!
> >
> > [2. OpenPGP public key --- application/pgp-keys; 
> > OpenPGP_0x640A6795ECDAAC2F.asc]...
> >
> > [[End of PGP Signed Part]]
> Grepping through the source code didn't reveal any meaningful references
> to yaml.
> There is an ad-hoc config generator in gnu/services/web.scm that
> generates a tailon-config.yml, but at a quick glance it doesn't seem to
> be a generic converter.  But maybe it's a good starting point?
> I checked guile-libyaml but it is only a parser and doesn't support
> serializing Scheme into YAML as far as I can tell.

You can always just cheat a bit by using the fact that pretty much any JSON is a
valid YAML.  So just serialize to that and name the file .yaml.  ^_^


There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

Attachment: signature.asc
Description: PGP signature

reply via email to

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