From: Tanguy LE CARROUR <tanguy@bioneland.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Contributing Guix Home services
Date: Thu, 20 Apr 2023 17:28:52 +0200 [thread overview]
Message-ID: <168200453237.12030.10686882904904843012@localhost> (raw)
In-Reply-To: <87jzyaeih5.fsf@gnu.org>
Hi Ludo’,
Quoting Ludovic Courtès (2023-04-17 15:39:02)
> Tanguy LE CARROUR <tanguy@bioneland.org> skribis:
> > It's been quite a journey on my side! Ups. Downs. Mostly downs, though! 😅
> > Thanks to Simon's unconditional technical and moral support, a **LOT**
> > has changed since I sent this message. Hopefully for the better! 🤞
>
> Heh. :-) While it’s fresh on your mind, it would be nice to list the
> problems you ran into on your journey and see what we can do about it.
Mostly figuring out how to test it!
On my machine at home, `guix home reconfigure` can take minutes.
And some errors don't actually show up.
After trying different solutions, I eventually settled on the following:
while developing, I add, at the end of service file, something like:
```scheme
(define configuration
(home-service-configuration
; […]
)
(mixed-text-file
"test"
(serialize-configuration configuration home-service-configuration-fields))
```
And then I run:
```console
> cat (guix build -f path/to/home/service.scm)
# … the content of the generated file
```
I can only test file generation, though.
Then I painfully discovered that replacing in a string is not as easy as
it sounds, or, more precisely, that "python replace in string" yields
better results than "scheme replace in string" in DuckDuckGo!
I've also used `gexp` in places where I'm not sure it makes any sense,
but it works, so… #pragmatic!
> > At least now one of them [1] looks like a decent home service. Except
> > for the problem with `(every khal-calendar? lst)` that I haven't figure
> > out yet.
> >
> > [1]: https://git.easter-eggs.org/bioneland/guix/-/blob/main/bioneland/home/services/khal.scm
> >
> >
> > The one for MSMTP [2] does not contain all the available options, but all
> > the configurations and serializers are there.
> >
> > [2]: https://git.easter-eggs.org/bioneland/guix/-/blob/main/bioneland/home/services/msmtp.scm
>
> I don’t use these two programs, but the services look nice! The extra
> bit of work you’d have to do is documentation, similar to what is done
> for the other Home services. Maybe start with msmtp to get a feel of
> what that entails?
`(configuration->documentation 'home-msmtp-configuration)`
`(configuration->documentation 'msmtp-account)`
`(configuration->documentation 'msmtp-configuration)`
… *et voilà !*
> >> There’s no formal rule, but I think that what we’ve been doing so far is to ensure basic functionality of
> >> the service is covered, and to provide an “escape hatch” for bits of the
> >> configuration that are not covered.
> >
> > If by "escape hatch" you mean `extra-config`, you're right!
>
> Yup!
The convention seems to be `extra-content`, but you knew what I meant, right!? 😅
> > I'll try to submit a patch for one of the two mentioned above soon…ish!
>
> Excellent, thanks!
Done! <https://issues.guix.gnu.org/62969>
I could have done a **lot** more with the documentation, but I wanted to
be sure to get the basic right first.
--
Tanguy
next prev parent reply other threads:[~2023-04-20 16:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-25 16:53 Contributing Guix Home services Tanguy LE CARROUR
2023-04-04 7:45 ` Tanguy LE CARROUR
2023-04-13 20:42 ` Ludovic Courtès
2023-04-14 12:03 ` Tanguy LE CARROUR
2023-04-17 13:39 ` Ludovic Courtès
2023-04-20 15:28 ` Tanguy LE CARROUR [this message]
2023-05-03 20:42 ` Ludovic Courtès
2023-05-17 7:16 ` Tanguy LE CARROUR
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=168200453237.12030.10686882904904843012@localhost \
--to=tanguy@bioneland.org \
--cc=guix-devel@gnu.org \
--cc=ludo@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.